excel - If two cells contains certain text put the text value of the adjacent cell into a new cell -
i wanted ask how in excel can match text value in 2 columns , if there match, copy/paste value of adjacent cell new cell.
for example:
b c l m gene_id gene value ... gene_id gene xloc001 top 20 xloc003 ? xloc002 high 5 xloc001 ? xloc003 left 45 xloc002 ? xloc004 right 10 xloc004 ?
the formula in column m in first row in column l , find match in column a. if there match return value in column b. can copy/paste formula other rows in column m.
the output be:
b c l m gene_id gene value ... gene_id gene xloc001 top 20 xloc003 left xloc002 high 5 xloc001 top xloc003 left 45 xloc002 high xloc004 right 10 xloc004 right
use display default message of "n/a" if value not found. dollar signs in range reference makes sure range stays same when copy , paste formula.
=vlookup(l2, $a$2:$b$5, 2, false)
use display message of "not found" if value not found:
=iferror(vlookup(l2, $a$2:$b$5, 2, false), "not found")
or leave cell blank:
=iferror(vlookup(l2, $a$2:$b$5, 2, false), "")
(simplified previous code, credit goes chancea.)
Comments
Post a Comment