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

Quick Links

  • VLOOKUP Versus INDEX and MATCH

  • INDEX and MATCH Function Basics

  • How to Use INDEX and MATCH in Excel

While the VLOOKUP function is good for finding values in Excel, it has its limitations. With a combination of the INDEX and MATCH functions instead, you can look up values in any location or direction in your spreadsheet.

The INDEX function returns a value based on a location you enter in the formula while MATCH does the reverse and returns a location based on the value you enter. When you combine these functions, you can find any number or text you need.

VLOOKUP Versus INDEX and MATCH

The difference between these functions and VLOOKUP is that VLOOKUP finds values from left to right. Hence the function's name; VLOOKUP performs a vertical lookup.

Microsoft best explains the way VLOOKUP works:

There are certain limitations with using VLOOKUP---the VLOOKUP function can only look up a value from left to right. This means that the column containing the value you look up should always be located to the left of the column containing the return value.

Microsoft goes on to say that if your sheet isn't set up in a way where VLOOKUP can help you find what you need, you can use INDEX and MATCH instead. So let's look at how to use INDEX and MATCH in Excel.

INDEX and MATCH Function Basics

To use these functions together, it's important to understand their purpose and structure.

The syntax for INDEX in Array Form is

INDEX(array, row_number, column_number) 

with the first two arguments required and the third optional.

INDEX looks up a position and returns its value. To find the value in the fourth row in the cell range D2 through D8, you would enter the following formula:

=INDEX(D2:D8,4)
How to Use INDEX and MATCH in Microsoft Excel (1)

The result is 20,745 because that's the value in the fourth position of our cell range.

For more details on the Array and Reference Forms of INDEX as well as other ways to use this function, take a look at our how-to for INDEX in Excel.

The syntax for MATCH is MATCH(value, array, match_type) with the first two arguments required and the third optional.

MATCH looks up a value and returns its position. To find the value in cell G2 in the range A2 through A8, you would enter the following formula:

=MATCH(G2,A2:A8)
How to Use INDEX and MATCH in Microsoft Excel (2)

The result is 4 because the value in cell G2 is in the fourth position in our cell range.

For additional details on the match_type argument and other ways to use this function, take a look at our tutorial for MATCH in Excel.

Related: How to Find a Value's Position With MATCH in Microsoft Excel

How to Use INDEX and MATCH in Excel

Now that you know what each function does and its syntax, it's time to put this dynamic duo to work. Below, we'll use the same data as above for INDEX and MATCH individually.

You'll place the formula for the MATCH function inside the formula of the INDEX function in place of the position to look up.

To find the value (sales) based on the location ID, you would use this formula:

=INDEX(D2:D8,MATCH(G2,A2:A8))

The result is 20,745. MATCH finds the value in cell G2 within the range A2 through A8 and provides that to INDEX which looks to cells D2 through D8 for the result.

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

Let's look at another example. We want to know which city has sales that match a certain amount. Using our sheet, you would enter this formula:

=INDEX(B2:B8,MATCH(G5,D2:D8))

The result is Houston. MATCH finds the value in cell G5 within the range D2 through D8 and provides that to INDEX which looks to cells B2 through B8 for the result.

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

Here's an example using an actual value instead of a cell reference. We'll look for the value (sales) for a specific city with this formula:

=INDEX(D2:D8,MATCH("Houston",B2:B8))

In the MATCH formula, we replaced the cell reference containing the lookup value with the actual lookup value of "Houston" from B2 through B8 which gives us the result 20,745 from D2 through D8.

Be sure when you use the actual value to look up, rather than a cell reference, that you enclose it in quotes as shown here.

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

To obtain that same result by using the location ID instead of the city, we simply change the formula to this:

=INDEX(D2:D8,MATCH("2B",A2:A8))

Here we changed the MATCH formula to look up "2B" in the cell range A2 through A8 and provide that result to INDEX which then returns 20,745.

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

Basic functions in Excel like those that help you add numbers in cells or enter the current date are certainly helpful. But when you start adding more data and advancing your data entry or analysis needs, lookup functions like INDEX and MATCH in Excel can be quite useful.

Related: 12 Basic Excel Functions Everybody Should Know

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

FAQs

How to Use INDEX and MATCH in Microsoft Excel? ›

How to use the INDEX Formula? To use INDEX MATCH in Excel, first identify the range where you want to look up a value. Use MATCH to find the row number where your lookup value is located. Then, use INDEX to retrieve the value from the specific row and column you need.

How to use INDEX and match formula in Excel? ›

How to use the INDEX Formula? To use INDEX MATCH in Excel, first identify the range where you want to look up a value. Use MATCH to find the row number where your lookup value is located. Then, use INDEX to retrieve the value from the specific row and column you need.

How do I use match and INDEX in place of VLOOKUP? ›

INDEX and MATCH – the Perfect Substitute of VLOOKUP
  1. You can find more about the Lookup functions (VLOOKUP/HLOOKUP) and how to use them in our previous article.
  2. INDEX is a formula, which returns the value located at a given intersection within an array.
  3. =INDEX(B4:C12,5,2)
  4. =MATCH(B19,B4:B12,0)
  5. =MATCH($I4,$B$4:$B$12,0)

Is INDEX match better than VLOOKUP? ›

VLOOKUP has been popular for a long time because it's simple and easy. But INDEX MATCH is gaining popularity because it's more flexible and powerful. Understanding why INDEX MATCH is often seen as better than VLOOKUP can really improve how you work with data in Excel. It can make your work faster and more accurate.

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 an example of an INDEX in Excel? ›

The result of the INDEX function is a reference and is interpreted as such by other formulas. Depending on the formula, the return value of INDEX may be used as a reference or as a value. For example, the formula CELL("width",INDEX(A1:B2,1,2)) is equivalent to CELL("width",B1).

How do I match an INDEX with two criteria in Excel? ›

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.

How the INDEX () and match () functions are combined to lookup data? ›

The INDEX function actually uses the result of the MATCH function as its argument. The combination of the INDEX and MATCH functions are used twice in each formula – first, to return the invoice number, and then to return the date. Copy all the cells in this table and paste it into cell A1 on a blank worksheet in Excel.

How do I do a VLOOKUP and match data? ›

In its simplest form, the VLOOKUP function says: =VLOOKUP(What you want to look up, where you want to look for it, the column number in the range containing the value to return, return an Approximate or Exact match – indicated as 1/TRUE, or 0/FALSE).

Why is my INDEX match not working? ›

If you believe that the data is present in the spreadsheet, but MATCH is unable to locate it, it may be because: The cell has unexpected characters or hidden spaces. The cell may not be formatted as a correct data type. For example, the cell has numerical values, but it may be formatted as Text.

Is it better to use xlookup or INDEX match? ›

In general, XLOOKUP is faster than INDEX MATCH for simple lookups, but INDEX MATCH can be faster for more advanced scenarios. Here are the key considerations to guide your choice: Use XLOOKUP if: You are working with Excel 365 or 2021.

What is the best use of INDEX match? ›

Performing a multiple-criteria lookup

For example, if you have a sheet with columns displaying different types of clothes and the size, color and price of each item, you can use INDEX and MATCH to find a specific article of clothing in a specific color and size by inputting its price.

What replaced INDEX match in Excel? ›

XLOOKUP was released by Microsoft 365 in 2019 and is meant as the replacement for VLOOKUP, HLOOKUP, INDEX/MATCH functions. Like VLOOKUP or INDEX/MATCH, there are 3 mandatory arguments. The last 3, which are in square brackets, are optional arguments: lookup_value: this is the value you are searching for.

How to use match and INDEX together? ›

=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. Combined, the two formulas can look up and return the value of a cell in a table based on vertical and horizontal criteria.

How do I practice INDEX match in Excel? ›

Index Match Function Excel: Combining INDEX and MATCH

First, Excel looks in the G2:G11 column for the number 6. It needs an exact match because of the 0 in this function: MATCH(6,G2:G11,0). It finds this number 6 in row 7 of this range.

Why do we use INDEX and match in Excel? ›

The INDEX MATCH function is one of Excel's most powerful features. The older brother of the much-used VLOOKUP , INDEX MATCH allows you to look up values in a table based off of other rows and columns. And, unlike VLOOKUP , it can be used on rows, columns, or both at the same time.

How to create a nested formula using INDEX and MATCH in Excel? ›

Click the cell where you want to add the nested functions. Click the Formulas tab. Click the Lookup & Reference button in the Function Library group. You will start with the INDEX function and nest the MATCH function within it.

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.

Can you use INDEX and match with text in Excel? ›

The Match function in Excel is dedicatedly designed to search for a given term, part, or text in a range of cells. If the target text is found, then the function returns the index value of the target text. Else a relevant message is displayed on the screen.

References

Top Articles
Latest Posts
Article information

Author: Dean Jakubowski Ret

Last Updated:

Views: 5805

Rating: 5 / 5 (50 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Dean Jakubowski Ret

Birthday: 1996-05-10

Address: Apt. 425 4346 Santiago Islands, Shariside, AK 38830-1874

Phone: +96313309894162

Job: Legacy Sales Designer

Hobby: Baseball, Wood carving, Candle making, Jigsaw puzzles, Lacemaking, Parkour, Drawing

Introduction: My name is Dean Jakubowski Ret, I am a enthusiastic, friendly, homely, handsome, zealous, brainy, elegant person who loves writing and wants to share my knowledge and understanding with you.