Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lookup a value that matches a key in one column then apply that as a key to return a value from a third column

I have values in columns G and N that have the same values, but not in the same order, so if column G and N matches, then return column L to column A. I am getting the wrong values from column L in column A.

What other information is needed besides formula below?

=IFERROR(VLOOKUP(N2,$G$2:$N$413,6,FALSE),"")  
Col a      Col b    Col G    Col L   Col M    Col N
    ID     CoID     Items    ItemsID ParentID Items1
    45     1        Apple    45      1        Apple
like image 398
turb03D Avatar asked Nov 19 '25 05:11

turb03D


1 Answers

Since you are trying to find the ColumnL value in the same row as you find the ColumnN value I’d suggest an INDEX MATCH combination – similar to VLOOKUP but more powerful (eg can ‘look to the left’, which VLOOKUP can’t).

=IFERROR(INDEX(L:L,MATCH(G2,N:N,0)),"") 

MATCH looks for the position where G2 is found in ColumnN so that is the row number for the ColumnL value you want returned.

like image 106
pnuts Avatar answered Nov 21 '25 21:11

pnuts



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!