You don't need Lookup
, but VLookup
, let me show you:
=VLOOKUP(D4,$D$4:$H$20,2,FALSE)
This means (in case "Mary" is put in cell D4): go look in to D4:H20 (made invariable using the dollar signs), and take the second column (containing the "D") variable.
If you want to find "J" (third column), use:
=VLOOKUP(D4,$D$4:$H$4,3,FALSE)
If you want to find "P" (fourth column):
=VLOOKUP(D4,$D$4:$H$4,4,FALSE)
The last parameter is just for having an exact search.
You can use INDEX MATCH based approach like this:
=INDEX(G1:G6,SUM((H1:L6=D1)*ROW(H1:L6)))
If you have a version of Excel older than 2016, you will have to enter this formula with CTRL+SHIFT+ENTER.
NOTE - this only works if the table starts in row 1.
So to make it more general, you could do:
=INDEX(G1:G6,SUM((H1:L6=D1)*(ROW(H1:L6)-ROW(H1)+1)))
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.