No doubt, VLOOKUP is one of the most popular Excel functions. It’s simple to use and easy to understand.

It can help you to quickly lookup for a value in a column. But, when you use it more and more you will realize that there are some problems with it.

And, the biggest problem is it’s not dynamic.

In VLOOKUP, col_index_no is a static value which is the reason VLOOKUP doesn’t work like a dynamic function.

If you are working on a multiple column data, it’s a pain to change its reference because you have to do (change column number) this manually.

The best way to solve this problem is to use MATCH Function in VLOOKUP for col_index_number.

So today, in this post, you will learn to combine **VLOOKUP and MATCH**.

...let's get started.

## Problems With VLOOKUP

I have found two biggest reason 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 for the Feb 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 the “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 have added 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 if you need something else.

At this point, you are clear about one thing that 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 match function and its working.

The basic use of MATCH is to find the cell number of the lookup value from a range.

Syntax:

MATCH(lookup_value,lookup_array,[match_type])

It has mainly three arguments, lookup value, a range to lookup for the value, and the match type to specify exact match or an approximate match.

For example, in the below data I am lookup for the name "John" with the match function from 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 a cell enter month name and in another cell enter employee’s name.
- After that, enter below formula in the third cell.

In the above formula, you have used VLOOKUP to lookup for the MAY month and for the col_index_num argument you have used match function instead of a static value.

And in match function, you have used “John” (employee name) for the lookup value.

Here match function has returned the cell number for the “John” from the above row. After that, VLOOKUP has used that cell number to return the value.

In simple words, 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 that those problems are solved or not.

### #1 Static Reference

You have referred employee name in match function to get the column number for VLOOKUP.

So, now when you change employee name in the cell, match function will change the column number.

...and when you need to get the value for a different employee you just 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 formula again and again.

### #2 Add or Delete Columns

Before adding a new column John's data was is in the 2nd column and match function return 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 value in the formula not changed because the match function updates its value.

In this way, you’ll always get the correct column number even when you insert/delete any column. MATCH function will return the right column number.

## Sample File

Download this sample file from here to learn more.

## Conclusion

Using VLOOKUP and MATCH functions together not only makes VLOOKUP dynamic but also makes it more powerful in term of handling large data.

And, you can change col_index_num without actually editing it.

I hope you you found this formula tip useful and now tell me one thing.

*What's do you think about this combination of VLOOKUP and MATCH?*

Please share your views with me in the comment section I'd love tp hear from you and make sure to share this tip with your friends, I'm sure they will appreciate it.

Related Functions

- IFERROR with VLOOKUP: While using VLOOKUP, whenever the value for which you are looking for is not there in the data [...]
- Wildcards with VLOOKUP: A normal VLOOKUP doesn’t allow you to lookup for a value like this, but when you combine an asterisk which [...]
- VLOOKUP with Multiple Criteria: Advanced Excel users know that there are so many things which we can’t do with VLOOKUP or they need to put some [...]
- Two Way Lookup In Excel: It happens sometimes when we need to lookup for a value from a table according to the row heading [...]
- INDEX MATCH: The combination of these two functions can match the gap of all other functions which we use for lookup [...]

Balaji26 Nov, 18 at 8:23 pmHi punnet,

Thanks for your knowledge sharing. It’s really helpful… suppose if we have multiple columns which needs to be vlookup from other file to current file based on one column information, in such case we do manually change the no. of columns in each row. So is there any standard formula while copy n paste the formula from one cell to another cell (no. of columns should auto update)..

Tanveer Khan21 Nov, 18 at 6:18 amThe way of explaining is great I understand with the concept Thanks…

Sandeep21 Nov, 18 at 1:09 amHi Puneet,

Question: In this lookup formula can lookup column be from right to left like Index-Match formula?

Statement: The articles are simple and easy to understand.

Sreedhara Chary19 Nov, 18 at 3:22 pmPuneet,

Thank you for your continuous support. Your methods of explanation is simple and effective.

I regularly get your mails and they are/will be adding a lot value to my profession.

Thanks again 🙂

Levanon19 Nov, 18 at 3:04 pmThanks a lot Puneet, your tips & tricks are always userful & efficient

Note should be made that the same result can be obtained with the combination of Index() & Match() formulas (I think it’s one of your previous tips)…

In fact when your lookup_array is dynamic the index + match are much better especially since you can apply them for a whole column and it does work beautifully

==

See the latest I’ve actually written today: =INDEX(Month!$E:$E,MATCH($G2,Month!$A:$A,0)) where “month” is a sheet containing the lookup table this is as flexible as can be…

sara11 Oct, 18 at 5:20 amHi,

I want excel formula for remove duplicate and get unique values without any reference. Please suggest me…

Thank you!

http://www.ju.edu.jo

Levanon19 Nov, 18 at 3:11 pmThere’s no need for formula, you can either use conditional formatting for duplicate values or the DATA->Remove Duplicates from the main ribbon

Ali Sarmad19 May, 17 at 4:47 amSuuuuuuuuuuuuuuuperb trick (Y)

Tim Frielingsdorf6 Mar, 17 at 3:59 pmWhere do you see the advantage of VLOOKUP and MATCH versus INDEX and MATCH?

Mustjab Ali20 Nov, 18 at 7:08 amIt seems he is speechless 🙂

Manali8 Jan, 17 at 6:34 amThese Tips and Explanations are simply Excellent and am Elated to join abd subscribe and love downloading the materials. Thankyou so much.

Time to drive and upgrade my Excel Skills.

?

With Regards,

Manali

Puneet Gogia8 Jan, 17 at 3:08 pmI’m so glad you liked it.

William Kiarie24 Sep, 16 at 12:26 pmThis post is written in a very easy to understand format. It is a great approach especially when you have to insert/delete columns in your lookup table.

Puneet Gogia24 Sep, 16 at 12:39 pmThanks for your words. William.