INDEX and MATCH with multiple criteria
To lookup values with INDEX and MATCH, using multiple criteria, you can use an array formula. In the example shown, the formula in H8 is:
Note: this is an array formula, and must be entered with control + shift + enter.
How this formula works
Normally, and INDEX MATCH formula is configured with MATCH set to look through a one-column range and provide a match based on a given criteria. Without concatenating values in a helper column, or in the formula itself, there's no way to supply more than one criteria.
This formula works around this limitation by using boolean logic to create an array of ones and zeros to represent rows matching all 3 criteria, then using MATCH to match the first 1 found.
The temporary array of ones and zeros is based on this snippet:
Here we compare the item H5 against all items, the size in H6 against all sizes, and the color in H7 against all colors. the initial result looks like this:
The multiplication operation transforms the TRUE FALSE values to 1s and 0s:
And the final result looks like this:
Which goes into MATCH as the lookup array:
MATCH returns 3, and the entire formula boils down to a standard INDEX MATCH formula
with a final result of $17.00.
It is possible to add another INDEX to this formula, avoiding the need to enter as an array formula with control + shift + enter:
The INDEX function can handle arrays natively, so the second INDEX is added only to "catch" the array created with the boolean logic operation and return the same array again to MATCH. To do this, INDEX is configured with zero rows and one column. The zero row trick causes INDEX to return column 1 from the array (which is already one column anyway).