Using VLOOKUP and INDEX MATCH Formulas

Picture of Ren Leaflight       Picture of Baby Using Computer to Symbolize Savvy Rating

VLOOKUP Function

As an intermediate Excel user, you have probably used the VLOOKUP function in Excel to match data between two different tables.  VLOOKUP is legitimately a great function with lots of uses.  For example, you can match the budget information in one table with department information in another using the common department number.  The formula itself is pretty straight forward:

VLookup general formula


Lookup value:  This is the cell number of the data you want to use to match.  In the example below, this is the department number in cell A3.

Region with data:  This is the range of the table with the data to be matched.  The leftmost column must be the one you want to search for a matching value. In the example below, we start with A7 and go to D18.

Column index for return data: This is an index number for the column with the data you want returned.  The first column in the region you selected is 1, the second column is 2, and so on.  In our example, we want the value in the 3rd column to be returned.

Match type: This number tells Excel how you want to match.  “0” means only return an exact match.  You will almost always want to use 0.

Formula for VLOOKUP example



Results from the VLookup formula


Note that if there is no match, the formula returns an error so you might want to enclose VLOOKUP in the IFERROR function:

Enclosing VLookup in IFERROR formula


Downsides of the VLOOKUP Function

As great and powerful as the VLOOKUP function is, it does have some downsides.  It can only return a value that is to the right of the column that contains the lookup values. In our example, we can lookup up the Department name using the Department number, but we couldn’t do the reverse.  Also, if your table is a work in progress (and they usually are), you might want to add a new column.  When the new column is added, it can shift the index number you used to get your return value and presto your formula is broken.

INDEX & MATCH Function

There is a solution to these issues.  Using the INDEX and MATCH formulas together is little more complicated that VLOOKUP, but not terribly so and it is a lot more versatile.  Let’s break it down.

General formula for Match


The MATCH function returns a relative position for data that matches the lookup value you give it.  We want it to return the relative row number from the lookup column.  We only want an exact match to be returned so the match type should be 0.

Specific Match formula for example


So far MATCH is a lot like VLOOKUP, the only difference is it will return only the relative position, not the value in the cell.  Since we want the actual value in the cell, we wrap MATCH in a function called INDEX.  INDEX returns the value in a cell when given its relative position.

General Index Formula


For our purposes, there are three parts to the INDEX function:  return column, relative row number, and relative column number.  Return column is straight-forward, this is the same as with VLOOKUP. We just figured out the relative row number with our MATCH formula above. Since we are only giving INDEX one column, the relative column number will be 1.  Voila we have the final formula!

Index Match Formula for Example


This combination of INDEX and MATCH is a lot clearer about where the return data is located than VLOOKUP.  Instead of a relative column number, you have the actual column written out.  It also becomes easier to copy and paste this formula into more than one column if you want multiple values returned.

Copying Index Match to other columns


I recommend trying the INDEX MATCH combination wherever you would normally use VLOOKUP.  It will save you time and errors in the long run.



Leave a Reply

Your email address will not be published. Required fields are marked *