How to Use INDEX & MATCH in Microsoft Excel (2024)

Have you ever felt lost in a huge Excel spreadsheet especially when you need to look up a value along the rows or columns? Do you often scan through large Excel datasets to pinpoint interesting data and create a list of those manually, and put a huge strain on your eyes in the process? Then, you must how to use INDEX MATCH in Excel to perform advanced lookups in Excel.

When manipulating, analyzing, and visualizing datasets to extract actionable insights, you often need to look up queried or interesting data from a large dataset. I know you could go through each row, column by column to find the individual data, make a note of that, and repeat the process. But, that’s really not the process you should follow if you’re using Microsoft Excel in the first place.

In such a situation, you can combine INDEX and MATCH functions to locate data by providing Excel a reference or hint to which the queried data is related.

Whether you’re a seasoned Excel user or a beginner just starting out, this article will provide a step-by-step walkthrough to help you harness the full potential of INDEX MATCH. By the end of this guide, you’ll be able to perform complex lookups with ease, making your data analysis more efficient and insightful. Let’s begin!

What Is INDEX and MATCH in Excel?

Before you can learn the technical use cases of INDEX and MATCH functions in a single Excel formula, you must learn the basics of these formulas and how to write these functions.

INDEX

How to Use INDEX & MATCH in Microsoft Excel (1)

The INDEX formula in Excel allows you to retrieve the value of a cell within a specified range based on its row and column numbers. It’s a powerful dataset-crunching function commonly used for data lookup and array manipulation tasks. This formula is valuable for dynamic data analysis, allowing you to extract information based on specific criteria.

The INDEX formula syntax in Excel is:

=INDEX(array, row_num, [column_num])
  • Array: This is the range or array of data from which you want to retrieve a value. It can be a single row, a single column, or multiple rows and columns. The array should exclude the column headers of the dataset.
  • Row_Num: This is the row number within the array from which you want to retrieve the value. It can be a number, array, or reference to a single cell containing a number. The row number count works according to the highlighted array. If you’ve selected A2:A10, then cell A2 is row 1 and cell A10 is row 9.
  • [Column_Num]: This is the column number within the array from which you want to retrieve the value. If omitted, the column number defaults to the same as the row number. It’s optional if the array is one-dimensional. It’s only required when you include a lookup range consisting of multiple columns.

MATCH

How to Use INDEX & MATCH in Microsoft Excel (2)

You can use the MATCH formula in Excel to locate the position of a specified value within a range or array. It’s just the opposite of the INDEX function.

The MATCH formula syntax in Excel is:

=MATCH(lookup_value, lookup_array, [match_type])
  • Lookup_Value: This is the value you want to search for within the lookup_array.
  • Lookup_Array: This is the range of cells or array where Excel should search for the Lookup_Value.
  • [Match_Type]: This parameter specifies the type of match. This is an optional argument. Here are the notations and coding for Match_Type:
    • 1 or omitted: Finds the largest value less than or equal to the Lookup_Value and it’s the default setting.
    • 0: Finds an exact match and is hence suitable for text-based value searches.
    • -1: Finds the smallest value greater than or equal to the Lookup_Value.

The INDEX function requires a row number to locate the required value of a cell and the MATCH function can generate that row number.

Hence, by using MATCH as the row argument for INDEX you can easily locate individual values based on a criteria from massive dataset.

Advantages of INDEX MATCH Over VLOOKUP

  • INDEX MATCH can look up values in both rows and columns, while VLOOKUP is limited to searching in columns.
  • VLOOKUP always requires the looked-up value to be in the leftmost column of the look-up table.
  • INDEX MATCH allows for dynamic column selection, meaning you can easily change the column reference without modifying the formula.
  • With INDEX MATCH, if you rearrange columns in your dataset, the formula remains unaffected, whereas VLOOKUP requires adjusting column references.
  • INDEX MATCH handles errors more gracefully, returning #N/A only when no match is found, whereas VLOOKUP might return incorrect results if the column index is changed.
  • In large datasets, INDEX MATCH tends to perform better than VLOOKUP due to its computational efficiency.
  • INDEX MATCH can handle multiple criteria lookups more efficiently than VLOOKUP combined with helper columns.
  • INDEX MATCH can handle non-contiguous data ranges, which VLOOKUP cannot.

Simple INDEX and MATCH

Let’s try to understand the use of the INDEX MATCH combination formula in a simple dataset as shown above. In the above dataset, I’m going to locate the Candidates based on their Country using INDEX and MATCH.

How to Use INDEX & MATCH in Microsoft Excel (3)

For example, I need to find the candidate’s name from the US.

How to Use INDEX & MATCH in Microsoft Excel (4)

So, first I’ll enter the following MATCH formula in the destination cell to locate the row number where the target data is available in the look-up table.

=MATCH(F1,B2:B7,0)

After hitting Enter, I get the row number in the destination cell.

Now, I’m going to expand the same formula with INDEX, making the MATCH formula the row argument of the INDEX column.

How to Use INDEX & MATCH in Microsoft Excel (5)

Here’s the final combination of the formula:

=INDEX(A2:A7,MATCH(F1,B2:B7,0))

I’ve entered the above formula in the destination cell F2 and pressed Enter to get the queried value which is Margaret M.

Combine Table Data Using INDEX and MATCH

You can also creatively use this combination formula to import table data from a second table to the first table to make your dataset more comprehensive and organized.

How to Use INDEX & MATCH in Microsoft Excel (6)

For example, in the dataset shown above, you want to import rebate data to TABLE 1 from TABLE 2, so you can get rid of the second table.

So, I’ll show you how can you use INDEX and MATCH in Excel to assign discount percentages below the Rebate column in TABLE 1 by referring to categorical rebates in TABLE 2.

How to Use INDEX & MATCH in Microsoft Excel (7)

The first step is to find the row number by matching categories using the following MATCH formula in D3, the first cell below the Rebate column:

=MATCH([@Category],$G$3:$G$7,0)
How to Use INDEX & MATCH in Microsoft Excel (8)

Now that you’ve got the row number where the categorical discount value is located, expand the formula to make the MATCH formula the row argument of the INDEX formula. Then, you only need to highlight the Disc % column values so INDEX can populate the corresponding cell value in D3.

=INDEX($F$3:$F$7,MATCH([@Category],$G$3:$G$7,0))

Upon hitting Enter in D3, you get 0.1, the value of the first row located by the MATCH function.

How to Use INDEX & MATCH in Microsoft Excel (9)

Select D3 and click the % sign in the Number commands block of the Home tab in Excel to convert decimals to percentage values.

How to Use INDEX & MATCH in Microsoft Excel (10)

Now, drag the fill handle from D3 down until D12 to populate discount percentages for the rest of the hardware products.

Now, you can delete TABLE 2 to declutter your dataset.

Extract Data to a Table Using INDEX and MATCH

Often, you get unstructured and stacked datasets from which you can extract the important values to the main table for further storage or analysis of data. You can do so using the combination formula of INDEX and MATCH.

How to Use INDEX & MATCH in Microsoft Excel (11)

In the above dataset, the vendor emails have been recorded in a stacked manner, which is a challenge to implement any automation to extract vendor emails by hardware category and put that below the Vendor Email column.

However, if you introduce a little modification to the INDEX MATCH formula, you can populate the vendor emails relevant to the category of the products in the table.

How to Use INDEX & MATCH in Microsoft Excel (12)

Let’s find the row number for the relevant category in column E and put that in the cell C2 of the Vendor Email column. For this, you can use this MATCH formula. Hit Enter to get the row number.

=MATCH(B2,$E$2:$E$11,0)
How to Use INDEX & MATCH in Microsoft Excel (13)

Now, you can expand the above formula with INDEX to populate the value of the cell in the retrieved row number. In the formula, you must add 1 so that Excel can get the vendor email just below the row number fetched. Here’s the complete formula syntax:

=INDEX($E$2:$E$11,MATCH(B2,$E$2:$E$11,0)+1)
How to Use INDEX & MATCH in Microsoft Excel (14)

Now, simply expand the same INDEX MATCH formula down the Vendor Email column using the fill handle to get vendor emails for the rest of the hardware products.

INDEX and MATCH With Multiple MATCH Arrays

Sometimes, you might want to use more than one look-up value in MATCH to fetch row numbers which in turn you can use in INDEX to fetch the intended value.

How to Use INDEX & MATCH in Microsoft Excel (15)

Suppose, you’ve got a country and category-wise product discount worksheet as shown in the above screenshot.

Now, you want to refer to the Disc % column in TABLE 2 and populate the appropriate discount percentages in the Rebate column of TABLE 1.

How to Use INDEX & MATCH in Microsoft Excel (16)

First, you need to use the following MATCH formula which contains two look-up arrays in the cell E3:

=MATCH(1,($H$3:$H$12=B3)*($I$3:$I$12=C3),0)

The above formula populates the relevant row numbers from TABLE 2 for the hardware products in TABLE 1.

How to Use INDEX & MATCH in Microsoft Excel (17)

Now, expand the above formula with the INDEX formula to fetch the relevant discount amount in E3. The combination formula shall be as given below:

=INDEX($G$3:$G$12,MATCH(1,($H$3:$H$12=B3)*($I$3:$I$12=C3),0))
How to Use INDEX & MATCH in Microsoft Excel (18)

You shall get the decimal value 0.1 in E2. Which can be easily converted to percentage value from the Home > Number > % button.

How to Use INDEX & MATCH in Microsoft Excel (19)

Now, use the fill handle to apply the same formula and number formatting to the rest of the Rebate column in TABLE 1.

If you’re performing this method in earlier Excel desktop versions than Excel for Microsoft 365, you must press Ctrl + Shift + Enter to calculate the result instead of just the Enter key.

Row and Column-Wise Lookup Using INDEX and MATCH

So far, you’ve learned the techniques to use INDEX and MATCH together to fetch cell values by a queried row. However, you can also create lookup models where you can produce a cell value from the look-up table by referencing a row number and column number.

In this method, you’ll be using two MATCH functions to get the row number and column number arguments for INDEX. In turn, you get the cell value you’ve been looking for.

How to Use INDEX & MATCH in Microsoft Excel (20)

In the above dataset, I want to assign discount percentages for the hardware products below the Rebate column in TABLE 1. My reference table to assign discounts is TABLE 2. TABLE 2 has columns for product category and rebate percentages by country.

How to Use INDEX & MATCH in Microsoft Excel (21)

Let’s create the first MATCH for row number and the second MATCH for column number by using the following formula in E3:

=MATCH([@Category],$G$3:$G$7,0),MATCH([@Country],$H$2:$I$2,0)

I can’t press Enter just yet because doing so shall generate a formula error in Excel.

How to Use INDEX & MATCH in Microsoft Excel (22)

I must also add the INDEX formula to the above partial formula. The final INDEX MATCH formula becomes as given below:

=INDEX($H$3:$I$7,MATCH([@Category],$G$3:$G$7,0),MATCH([@Country],$H$2:$I$2,0))
How to Use INDEX & MATCH in Microsoft Excel (23)

Now, I can simply use the fill handle to populate the discount values for the rest of the cells in the Rebate column.

Conclusions

So far, you’ve discovered different ways to use the INDEX and MATCH functions in Excel to look up values easily with real-world datasets.

If you’ve tried all or some of the above methods, comment below which one you liked the most. Also, comment if you know a better trick and tip involving how to use INDEX MATCH in Excel.

How to Use INDEX & MATCH in Microsoft Excel (2024)

FAQs

How do you use INDEX match in Excel? ›

How to use INDEX and MATCH in Excel
  1. Add your data to the sheet. Before using the INDEX and MATCH functions to retrieve specific information, you can first create an Excel file and add your data. ...
  2. Introduce the INDEX function. ...
  3. Determine the cell range for your search. ...
  4. Introduce the MATCH function.
Jun 28, 2024

Why won't my INDEX match formula work? ›

You have used an array formula without pressing Ctrl+Shift+Enter. When you use an array in INDEX, MATCH, or a combination of those two functions, it is necessary to press Ctrl+Shift+Enter on the keyboard. Excel will automatically enclose the formula within curly braces {}.

How do you use INDEX match to get multiple values? ›

To perform an INDEX MATCH with multiple criteria in Excel, simply use an ampersand (&) to place multiple references in your lookup value and lookup array inputs in the MATCH formula.

Is INDEX match better than VLOOKUP? ›

Here are the most significant differences. INDEX/MATCH is more secure because you can't change the column to be shown as you can in a VLOOKUP range. INDEX/MATCH is also structurally better because moving columns around won't break. VLOOKUP could show something completely different.

What is the INDEX function in Excel with example? ›

Example 1
DataData
BananasPears
FormulaDescriptionResult
=INDEX(A2:B3,2,2)Value at the intersection of the second row and second column in the range A2:B3.Pears
=INDEX(A2:B3,2,1)Value at the intersection of the second row and first column in the range A2:B3.Bananas
1 more row

How do I use INDEX match between two Excel spreadsheets? ›

Here's how the INDEX MATCH pair function works:
  1. Use the first portion of the INDEX formula to set the range of data you want to display.
  2. Use the MATCH in the second part of the INDEX formula to designate what row to pull the data from.
  3. The third portion of the INDEX formula is optional.
Nov 8, 2021

What is the common problem with INDEX match? ›

A common error with Index Match is flipping the syntax of the function. For example, you may switch the values of the lookup and return columns. If you find this happens to you regularly, add a quality assurance step to your process by checking the data you enter to ensure it's correct each time.

What is the new formula replacing INDEX match? ›

A modernized alternative to MATCH, the XMATCH function was introduced concurrently with XLOOKUP and is only available in Excel 365 and Excel 2021. Here are the key improvements: Unlike MATCH, XMATCH defaults to an exact match, which aligns with most use cases.

Why is my INDEX match not working #ref? ›

The #REF! error shows when a formula refers to a cell that's not valid. This happens most often when cells that were referenced by formulas get deleted, or pasted over.

What is the difference between xlookup and INDEX match? ›

Unlike VLOOKUP and INDEX/MATCH, which default to approximate match, XLOOKUP defaults to the exact match. Additionally, you can use -1 to return the next smaller value if it doesn't find a match. Use 1 to return the next larger value if it doesn't find a match.

Can INDEX match add multiple results? ›

You can only return one value with INDEX/MATCH. But you can return more than one using a JOIN/COLLECT function. CHAR(10) is a function to go to the next line, between two evaluations. You can also add more criteria to the COLLECT function.

Does INDEX match only return the first value? ›

By default, lookup formulas in Excel like VLOOKUP and INDEX + MATCH will find the first match, but not other matches that may exist in a set of data. However, with some effort, you can make INDEX and MATCH return all matches.

What are the 5 common errors in Microsoft Excel? ›

This tool identifies common errors such as DIV/0!, #N/A, or #VALUE! and offers possible solutions. Additionally, you can utilise the 'IFERROR' function to handle errors and display custom messages. What are the five types of Excel errors? The five types of Excel errors are: #DIV/0!, #N/A, #NAME?, #NULL!, and #NUM!.

Can I replace VLOOKUP with INDEX match? ›

Using INDEX and MATCH instead of VLOOKUP

Use the combination of INDEX and MATCH functions instead. This example shows a small list where the value we want to search on, Chicago, isn't in the leftmost column. So, we can't use VLOOKUP. Instead, we'll use the MATCH function to find Chicago in the range B1:B11.

How to write an INDEX match? ›

The INDEX MATCH[1] Formula is the combination of two functions in Excel: INDEX[2] and MATCH[3]. =INDEX() returns the value of a cell in a table based on the column and row number. =MATCH() returns the position of a cell in a row or column.

How to use INDEX match with VLOOKUP? ›

Using INDEX and MATCH instead of VLOOKUP

Use the combination of INDEX and MATCH functions instead. This example shows a small list where the value we want to search on, Chicago, isn't in the leftmost column. So, we can't use VLOOKUP. Instead, we'll use the MATCH function to find Chicago in the range B1:B11.

How do I lookup a value in one column and return value from another in Excel? ›

Select 'Function' (Fx) > VLOOKUP and insert this formula into your highlighted cell. Enter the lookup value for which you want to retrieve new data. Enter the table array of the spreadsheet where your desired data is located. Enter the column number of the data you want Excel to return.

How to pull data from another sheet in Excel based on cell value? ›

The MATCH function can pull data from another Excel worksheet when used with the INDEX function. For example, if you want to pull the value in cell B8 from Sheet2 in a workbook, you can use the following formula: =INDEX(Sheet2! A1:B10,MATCH(B8,Sheet2! A1:A10,0),2).

How do I compare two lists in Excel? ›

Select all the cells in both lists. Press the “F5” key to open the “Go to Special” tool. Click on the button that says “Special.” Select the “Row differences” option, then click “o*k” to highlight all the cells with differences between the two rows.

References

Top Articles
Latest Posts
Article information

Author: Mr. See Jast

Last Updated:

Views: 6334

Rating: 4.4 / 5 (55 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Mr. See Jast

Birthday: 1999-07-30

Address: 8409 Megan Mountain, New Mathew, MT 44997-8193

Phone: +5023589614038

Job: Chief Executive

Hobby: Leather crafting, Flag Football, Candle making, Flying, Poi, Gunsmithing, Swimming

Introduction: My name is Mr. See Jast, I am a open, jolly, gorgeous, courageous, inexpensive, friendly, homely person who loves writing and wants to share my knowledge and understanding with you.