VLOOKUP’s third argument is a fixed number, so the formula breaks the moment you insert or delete a column. The fix is to replace that number with MATCH, which works out the column position for you: =VLOOKUP(C15,A1:E13,MATCH(C16,A1:E1,0),0).
MATCH looks up the heading in C16 across the header row and returns its position, which VLOOKUP then uses as the column index. Change the name in C16 and the formula pulls a different column with no editing. The 0 in both functions forces an exact match — leave it out and you’ll get wrong results on unsorted data.
One thing the combination doesn’t fix: if you insert a column inside your table range, the range itself still needs widening, so convert the data to an Excel Table (Ctrl+T) and use structured references, or point the range at whole columns.
The combo of VLOOKUP and MATCH is like a superpower. Well, as we all know, VLOOKUP is one of the most popular functions.
Right?
It can help you quickly look up a value in a column. But when you use it more and more, you will realize some problems with it. And the biggest problem is it’s not dynamic.
In VLOOKUP, col_index_num is a static value, which is the reason VLOOKUP doesn’t work as a dynamic function. And this is where you need to combine VLOOKUP with MATCH.
If you are working on multiple-column data, it’s a pain to change the reference (the column number) manually.
The best way to solve this problem is to use the MATCH function in VLOOKUP for col_index_number. Today in this post, I’m going to explain all the stuff you need to know to use this combo formula.
Problems With VLOOKUP
I have found the two biggest reasons to create a combination of these two functions.
1. Static Reference
Just look at the below data table where you have 12-month sales for four different employees.

Now, let’s say you want to look up the May month’s sale of “John”. The formula should be like this.
=VLOOKUP("May",A1:E13,2,0)
In this formula, you have mentioned 2 as the col_index_num because John’s sale is in the second column. But what will you do if your boss tells you to get the sales value for “Peter”?
You need to change the value in col_index_num because it’s not dynamic.
2. Add or Delete Columns
Now think in a different way. You need to add a new column for a new employee just before John’s column.
And here, John’s column number is 3 and your formula result is incorrect.

Again here, because col_index_num is a static value, you need to change it manually from 2 to 3, and again every time something changes.
At this point, you are clear about one thing: you need to make col_index_num dynamic. And for this, the best way is to replace it with the MATCH function.
Why Match Function
Before you combine VLOOKUP and MATCH, you need to understand the MATCH function and how it works. The basic use of MATCH is to find the position of the lookup value in a range.
Syntax: MATCH(lookup_value,lookup_array,[match_type])
It has three arguments: the lookup value, a range to look up the value in, and the match type to specify an exact match or an approximate match. Always use 0 for an exact match here. If you leave the match type out, MATCH uses 1 (approximate match), which can return the wrong position when the headings aren’t sorted.
For example, in the below data, I am looking up the name “John” with the MATCH function in a heading row.

And, it has returned 2 in the result because the name is in the 2nd cell of the row.
VLOOKUP and MATCH Together
Now, it’s time to put VLOOKUP and MATCH together. So, let’s continue with our previous example.
First of all, let’s create a formula by using both of the functions, and then we’ll understand how these two work together.
Steps to create this combo formula:
- First of all, in one cell enter the month’s name, and in another cell enter the employee’s name.
- After that, enter the below formula in the third cell.
=VLOOKUP(C15,A1:E13,MATCH(C16,A1:E1,0),0)

In the above formula, you have used VLOOKUP to look up the month of May, and for the col_index_num argument, you have used the MATCH function instead of a static value.
And in the MATCH function, you have used “John” (employee name) for the lookup value. Note that the heading row in MATCH (A1:E1) starts from the same column as the table (A1:E13), so the position MATCH returns is the right column number for VLOOKUP.

Here, the MATCH function has returned the position of “John” in the heading row. After that, VLOOKUP used that cell number to return the value.

In simple words, the MATCH function tells VLOOKUP the column number to get the value from.
Problems Solved?
Above you have learned about two different problems which are because of static col_index_num.
And, for this, you have combined VLOOKUP and MATCH. Now, we need to check whether those problems are solved or not.
1. Static Reference
You have referred to the employee name in the MATCH function to get the column number for VLOOKUP.
When you change the employee name in the cell, the MATCH function will change the column number. So, when you need to get the value for a different employee, you only have to change the employee name in the cell.
This way, you have a dynamic col_index_number.

Finally, you don’t have to edit the formula again and again.
2. Add or Delete Columns
Before adding a new column, John’s data was in the 2nd column, and the MATCH function returned 2. And after you have inserted a new column, John’s data is in the 3rd column, and MATCH returned 3.
When you add a new column for a new employee, the result of the formula doesn’t change, because the MATCH function updates the column number.

In this way, you’ll always get the correct column number even when you insert/delete any column. The MATCH function will return the right column number. Just insert the new column inside the table range (not after its last column), so that the table and heading references expand with it.
Handle Names That Are Not Found
If the month or the employee name isn’t in the table, the formula returns #N/A. Wrap it in IFERROR to show a message instead:
=IFERROR(VLOOKUP(C15,A1:E13,MATCH(C16,A1:E1,0),0),"Not found")
Before you hide the error, check the name for extra spaces or a different spelling, as they are the most common reasons for #N/A.
Alternatives: INDEX MATCH and XLOOKUP
VLOOKUP can only look in the first column of the table. INDEX with two MATCH functions doesn’t have that limit, and it gives the same result:
=INDEX(B2:E13,MATCH(C15,A2:A13,0),MATCH(C16,B1:E1,0))
And in Excel for Microsoft 365 and Excel 2021 or later, you can nest XLOOKUP to do the same job:
=XLOOKUP(C16,B1:E1,XLOOKUP(C15,A2:A13,B2:E13))
Frequently Asked Questions
Why does VLOOKUP MATCH return the wrong value?
Most of the time, the heading row in MATCH starts in a different column than the VLOOKUP table, so the position is off by one, or the match type 0 is missing in MATCH or VLOOKUP.
Can I use VLOOKUP MATCH with an Excel table?
Yes. Use the table name for the VLOOKUP range and TableName[#Headers] for MATCH. Both expand on their own when you add rows or columns to the table.
Is VLOOKUP MATCH case-sensitive?
No. Both functions treat “john” and “John” as the same value.
Thanks You. I have certainly visited your site teaching Excel more than a few numbers of occasions to learn many useful things.
Maybe I missed something you have already written. But when you Add/Del columns, doesn’t the lookup_array parameter of VLOOKUP also need to be changed? Its of cause possible to have the range of lookup_array(reference to) to dynamically change as well. But then again, I would probably choose to use something more flexible than VLOOKUP.
I hope that makes sense.