Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Three Dimensional Lookup Using INDEX/MATCH

Tags:

This was taken and improved slightly from Question that has since been deleted

For those who can see deleted posts, it was taken from here: https://stackoverflow.com/questions/39793322/three-dimensional-lookup-no-concatenate-or-named-ranges-excel


I'm trying to do a three dimensional lookup without named ranges or concatenates. Simplified, my data is on the form:

    Column1 Column2 Column3 Scott            P   1       2       3 M   4       5       6 N   7       8       9 George           P   10      11      12 M   13      14      15 N   16      17      18 

I now want to search for a specific Name and then for a specific letter within that names table, I then want to match this row number with a specific column.

I tried a simple INDEX/MATCH:

=INDEX(A:D,MATCH("M",A:A,0),MATCH("Column1",1:1,0)) 

And that works for the fist name but not any others as it finds the first instance of M.

How do I modify it to look for a different name?


I have answered below, but want to see if someone has a better solution.

like image 350
Scott Craner Avatar asked Sep 30 '16 14:09

Scott Craner


People also ask

Can you do INDEX match with 3 criteria?

To extract data with different criteria or conditions in Microsoft Excel, the combination of INDEX and MATCH functions is best suited so far. In this article, you'll get to learn how you can use these INDEX and MATCH functions together with 3 different criteria in Excel with proper illustrations.

Can I use VLOOKUP with INDEX match?

Both VLOOKUP and INDEX/MATCH are formulas you can use to look up a value in a dataset and fetch the corresponding value (just like you scan a menu and look for the price of the dish you want to order). In most cases, you can use these interchangeably.


1 Answers

I used an IF() statement array formula to find what the P row number was after the George row... I also needed to use the MIN() function to get the first P row number after the name.

Beyond that, it's a simple INDEX() function.... that racked my brain for over an hour :).

=INDEX($A$1:$D$9,MIN(IF((ROW(A1:A9)>MATCH($F$4,A1:A9,0))*(A1:A9=$F$5),ROW(A1:A9),"")),MATCH($F$6,$A$1:$D$1,0))

Don't Forget!
Use Ctrl+Shift+Enter when finishing the formula, so it gets evaluated as an array formula.

3 Dimensional Array Function

like image 174
CRUTER Avatar answered Oct 21 '22 11:10

CRUTER