Any legitimate Excel user has used VLOOKUP and knows the syntax by heart.Â (Lookup Value, Array, Column, etc.)Â But many of these same users have never used INDEX MATCH before.Â INDEX MATCH is one of several lookup formulas available in Excel. Â It has certain features that make it superior to VLOOKUP in many situations.Â Regardless of which method you think is better, (I have my opinion)Â it is definitely worth it to learn both formulas and have both at your disposal.
Please note that INDEX MATCH is designed for vertical lookups, which is the task that VLOOKUP performs.Â If you need to perform a matrix lookup, consider using one of the more powerful Excel lookup formula combinations such as INDEX MATCH MATCH, OFFSET MATCH MATCH, VLOOKUP MATCH, or VLOOKUP HLOOKUP.
The VLOOKUP function
First our point of reference: the trusty VLOOKUP formula.Â VLOOKUP returns a VALUE based on a defined array and column reference.Â The syntax from Excel is as follows:
=VLOOKUP ( lookup value , lookup array , column , range lookup )
Below is an example of using VLOOKUP to return the value “Shirts” based on the lookup value “1089.” Â (Please note that, because we input false for that portion of the syntax, we are not using the range lookup feature of VLOOKUP in this example)
Our goal was to lookup the Product of ID “1089” and VLOOKUP did that without a hitch.Â So how does INDEX MATCH replicate that functionality?
The INDEX function
The basic INDEX function returns a VALUE based on a defined array / column and a row number.Â The syntax from Excel is as follows:
=INDEX ( array , row number )
Below is an example of using INDEX to return theÂ value “Shirts,” assuming that you already know that the value is three cells down on your defined array.
(you also have the option toÂ specify column number, but that isn’t relevant in a basic INDEX MATCH formula)
If you go 3 cells down in the INDEX array, you get the value “Shirts.”Â But the problem we have when trying to do a lookup is that we typically don’t know what position our return value isÂ located, which in this case isÂ 3.Â The “3” needs to come from another formula.
The MATCH function
The basic MATCH function returns a NUMBER based on the relative position of a lookup value within a defined array / column.Â The syntax from Excel is as follows:
=MATCH ( Â lookup value , lookup array , match type )
Below is an example of using the MATCH formula to return theÂ position of “1089” within our column reference.
Since “1089” is three cells down in the array, the value “3” is returned.
When we combine both the INDEX formula and the MATCH formula,Â theÂ number that the MATCH formula returns becomes the row number for your INDEX formula.
=INDEX ( array ,Â MATCH formula )
Below is an example of using the INDEXÂ MATCH to returnÂ “Product Type”Â forÂ our lookup value.
As you can see, it returns the same value we got from VLOOKUP.
Differences Between the Formulas
One of the key difference with INDEX MATCH is that, rather than selecting an entire array table, you are only selecting the lookup column and the return column of what would beÂ a VLOOKUP array.Â While not a big deal when it comes to simple lookups, this can definitely become a factor if youÂ are dealing with largeÂ files that haveÂ thousands of lookups.Â Â By limitingÂ your arrays to only the lookup and return columns, you reduce the processing load on Excel.Â The difference is illustrated below.
The other key difference is that INDEX MATCH formulas work as a right to left lookup, whereas VLOOKUP only works left to right.Â As you can see in the example below, I can use INDEX MATCH toÂ lookup a value that is to the right of my return value using INDEX MATCH.Â This is not possible with the VLOOKUP formula, as you would have to rearrange your data set, or copy your lookup column so that it is alwaysÂ to theÂ left of your return value.
I reversed our formula by looking up the ID of the “Shirts” Product Type.Â I just changed our lookup value and swapped the lookup and returnÂ columns.
Remembering It All
A lot of Excel websitesÂ do a poor job of explaining how to use INDEX MATCH.Â I’m not saying my way is any better, but here’s any easy way to remember how to use the formula, if you don’t want to mess with the detailed explanations and know how to use VLOOKUP.Â Here’s how I think about the formula as I’m typing it in:
=INDEX ( Column I want a return value from , MATCH ( My Lookup Value , Column I want to Lookup against , Enter “0” ))