# How To Use INDEX and MATCH In A Table With INDIRECT In Excel

In this tutorial we’ll look at the traditional data range lookup using the INDEX and MATCH functions, but add a twist to look up the values in a table, plus a bonus twist using the INDIRECT function.

Here I have a data range with salespeople and sales numbers for 12 products:

Below that I want to pull the sales numbers for a specific salesperson from a Data Validation dropdown list, and copy it down for each product:

I’m going to use the traditional INDEX/MATCH function combination. You can learn more about these functions on my blog post located here. I’ll define the range for my INDEX portion of my formula with just the sales data from my data range, and use the MATCH function to define the row and column intersection. The formula is:

=INDEX(\$B\$2:\$M\$7,MATCH(\$B\$11,\$A\$2:\$A\$7,0),MATCH(A12,\$B\$1:\$M\$1,0))

Notice that I locked all the cell references using the F4 key to make them absolute cell references, except the one reference to the product in column A, so that will change as I copy it down.

Now, on the next tab, I have the same data, but in a table named SalesData. I can construct the same formula as with a data range, but notice that I don’t need to convert the references to the table to absolute, since they are already defined based on the columns of the table. The formula is:

Now, one last twist. Instead of using the MATCH function to define the column, let’s instead pre-define the range for the INDEX function using the INDIRECT function, and utilize the product names in column A to reference the appropriate column from our Table. That formula will be:

=INDEX(INDIRECT(“SalesData[“&A12&”]”),MATCH(\$B\$11,SalesData[Name],0))

For those not familiar with the INDIRECT function, it returns the reference specified by a text string. So in our formula, the INDIRECT portion is:

INDIRECT(“SalesData[“&A12&”]”)

What we’ve done is concatenate “SalesData[” with the Product name (in this case, cell A12 is “Prod1”), and then concatenated that with a closed bracket “]”. So the result of this INDIRECT function is SalesData[Prod1] which is the name of the first data column in our SalesData table.

One note of caution: the INDIRECT function is a VOLATILE function, which means it will recalculate every time the worksheet recalculates. For small data sets, this is not an issue, but with large data, that can slow your process down, so be careful when using any volatile function.

What can you do next?
Subscribe to this blog for more great tips in the future!
Check out my YouTube channel – click on the YouTube icon below!

Happy Excelling!

### 8 Responses to How To Use INDEX and MATCH In A Table With INDIRECT In Excel

1. Martrica February 28, 2016 at 3:38 pm #

I am trying to do something similar. Using your example is there a way to index match by the name and return back concatenate of Prod & Amount? In my results column I would like it read as Prod1 – 3036.

• Michael Rempel February 28, 2016 at 5:47 pm #

Martrica – yes you can quite simply. Instead of the formula in call C12 of the Tables worksheet being:

=INDEX(INDIRECT(“SalesData[“&A12&”]”),MATCH(\$B\$11,SalesData[Name],0))

Change it to:

=A12&” – “&INDEX(INDIRECT(“SalesData[“&A12&”]”),MATCH(\$B\$11,SalesData[Name],0))

This will concatenate the product name in column A with the values that the INDEX formula pulls

2. Carms March 1, 2017 at 8:38 pm #

Can I use IF/INDEX/MATCH to find cross of amount/item in a full sheet that contains not only amounts but categories (information shifts too much depending on available data to use vlookup/hlookup) and return 0 if that info is not available?

Tried the following:

=IFERROR(INDEX(pos!A1:AT81,MATCH(Wkly!B60,pos!A50:V78,0),MATCH(Wkly!B57,pos!A50:V78,0)),0)
Wkly is tab one where i want values to show up/ pos is tab where i would like to extract value from

=IF(ISERROR(MATCH(\$B\$57&B59,pos!\$A\$4:\$U\$72,0)),0,INDEX(pos!\$A\$4:\$U\$72,MATCH(\$B\$57&B59,pos!\$A\$4:\$U\$72,0)))

=IFERROR(INDEX(pos!\$A\$4:\$U\$72,MATCH(Wkly!B66,pos!\$A\$4:\$U\$72,0),MATCH(Wkly!\$B\$57,pos!\$A\$4:\$U\$72,0)),0)

nothing works

3. David J. Myers October 26, 2017 at 5:39 pm #

Michael,

Thank you for this tutorial and for providing the example workbook. I’ve been making heavy use of INDEX/MATCH for nearly a decade, but your tutorial has just significantly improved my game.

Thanks!

Kind regards,

David Myers

• Michael Rempel October 26, 2017 at 9:15 pm #

4. César November 22, 2017 at 12:14 pm #

Hi Michael,

I’m using this formular =INDEX(INDIRECT(“‘”&Drop &”‘!”&”d2:ao60”);MATCH(“test”;INDIRECT(“‘”&Drop&”‘!”&”c2:c60”);0);MATCH(C\$30;INDIRECT(“‘”&Drop&”‘!”&”d1:ap1”);0);MATCH(Sheet1!C4;INDIRECT(“‘”&Drop&”‘!”);0))

Drop is a name range reference to various sheets
test is one of the match conditions
C\$30 is a date
Sheet1!C4 is a drop down where i make the selection of what sheet i want the results

the result of this is always n/a 🙁