How to use INDEX and MATCH Function in Excel: A Complete Tutorial
Looking for a more flexible and powerful alternative to Excel’s VLOOKUP? The INDEX and MATCH functions are the perfect duo for advanced data lookup and retrieval. This article provides a complete tutorial on how to use INDEX and MATCH in Excel, covering their individual roles and how they work together to handle complex lookup tasks. Whether you’re managing large datasets, creating dynamic reports, or needing to search data in multiple directions, this guide will help you unlock the full potential of these versatile functions.

INDEX and MATCH Function in Excel
Table of Content
What is INDEX Function in Excel
The INDEX function in Excel is very powerful at the same time a flexible tool that retrieves the value at a given location in a range. In another word, It returns the content of a cell, specified by row and column offset.
INDEX Function Syntax in Excel:
=INDEX(reference, [row], [column])
Parameters:
- array: The data range where the lookup is performed.
- row_num: The row number of the value to retrieve.
- column_num (optional): The column number of the value to retrieve.
How to Use INDEX Function in Excel
Follow the below steps to learn how to use INDEX Function in Excel:
Step 1: Select the Data Range
Identify the range where your data is stored, such as A1:C10.
Step 2: Specify the Row Number
Enter the row number that contains the data point you need.
Step 3: Specify the Column Number
If your array is more than one column wide, you can enter a column number to locate the exact cell.
The following table will be used as a reference table for all the examples of the INDEX function. First Cell is at B3 (“FOOD”) and the Last Diagonal Cell is at F10 (“180”).

Reference Table
Example 1: No Rows and Columns are mentioned.
If neither the row nor the column is specified, the INDEX function will return the entire data range.
Step 1: Input Command
Use Command “=INDEX(B3:C10)”
Step 2: Preview Result
Preview the below result

Preview Results
Example 2: Only Rows are Mentioned
If only the row number is provided, the INDEX function will return all values in that row within the range.
Step 1: Input Command
=INDEX(B3:C10,2)
Step 2: Preview Result
Returns all values from the second row of the range (e.g., B4:C4).

Preview Results
Example 3: Both Row and Column Specified
When both the row and column numbers are specified, the INDEX function will return the value from the specific cell.
Step 1: Input Command
=INDEX(B3:D10,4,2)
Step 2: Preview Result
Returns the value from the fourth row and second column of the range (e.g., C6).

Preview Results
Example 4: Only Column Specified
If only the column number is provided, the INDEX function will return all values from that column within the range.
Step 1: Input Command
=INDEX(B3 : D10 , , 2)
Step 2: Preview Results
Returns all values from the second column of the range (e.g., C3:C10
).

Preview Results
Challenges with the INDEX Function
While the INDEX function is highly flexible, its primary limitation is the need to manually specify the row and column numbers to retrieve data. This can become cumbersome when working with large datasets, such as those with thousands of rows and columns.
Solution: Combine INDEX with MATCH
To overcome this limitation, you can pair the INDEX function with the MATCH function. The MATCH function dynamically identifies the row or column number based on specific conditions, making it easier to locate data within large datasets.
What is MATCH Function in Excel
The MATCH function in Excel is used to locate the position of a specific value within a row, column, or array. Unlike VLOOKUP or HLOOKUP, the MATCH function does not return the actual data but instead provides the relative position of the value. It is case-insensitive and works seamlessly in both horizontal and vertical ranges.
MATCH Function Syntax
=MATCH(search_key, range, [search_type])
Parameters
lookup_value
: The value to search for (e.g., a number, text, or reference like42
,"South Indian"
, orI24
).lookup_array
: The range or array of cells to search. It must be a one-dimensional range (either a single row or a single column, e.g.,A1:A10
orA2:D2
).match_type
(optional): Defines the type of match to perform:1
(default): Finds the largest value less than or equal to the lookup value (requires ascending sorted data).0
: Finds the exact match (commonly used for unsorted data).-1
: Finds the smallest value greater than or equal to the lookup value (requires descending sorted data).
How MATCH Works with INDEX
The MATCH function is often paired with the INDEX function to dynamically determine the row or column number, enabling precise data retrieval. For instance, if you want to find the position of an item and use that position in the INDEX function to retrieve corresponding data, the MATCH function provides a seamless solution.
How to Use MATCH Function in Excel
Follow the below steps to learn how to use MATCH Function in Excel:
Step 1: Choose the Lookup Value
Identify the specific value you want to locate within your dataset. This could be a number, text, or a cell reference.
Step 2: Select the Lookup Range
Define the one-dimensional range (row or column) where Excel should search for the lookup value.
Step 3: Specify the Match Type
- Use
0
for an exact match. - Use
1
for an approximate match in ascending order. - Use
-1
for an approximate match in descending order.
MATCH Function Example
Reference Table: The following table will be used as a reference table for all the examples of the MATCH function. First Cell is at B3 (“FOOD”) and the Last Diagonal Cell is At F10 (“180”)
.webp)
Reference Table
Example 1: Exact Match (match_type = 0)
Find the row number of the food type “South Indian”.
Step 1: Input Command
=MATCH(“South Indian”,C3:C10,0)
Step 2: Preview Results
The function returns 1, as “South Indian” first appears in the first row of the lookup range.
.webp)
Preview Results
Example 2: Approximate Match in Ascending Order (match_type = 1)
Find the position of the largest value less than or equal to 70 in the Cost column.
Step 1: Input Command
=MATCH(“South Indian”,C3:C10)
- Sort the Cost column in ascending order.
- Input the formula and press Enter.
Step 2: Preview Results
The function returns 2, as the largest value less than or equal to 70 is 50 (located in the second row of the range).

Preview Results
Example 3: Approximate Match in Descending Order (match_type = -1)
Find the position of the smallest value greater than or equal to 80 in the Cost column.
Step 1: Input Command
=MATCH(80, D3:D6, -1)
- Sort the Cost column in descending order.
- Input the formula and press Enter.
Step 2: Preview Results
The function returns 2, as the smallest value greater than or equal to 80 is 80 (located in the second row of the range).

Input Command
How to use the INDEX MATCH Excel Function Combination
The combination of INDEX and MATCH in Excel is a dynamic and efficient way to perform data lookups. Unlike using static row and column numbers in the INDEX function, you can use the MATCH function to dynamically determine the positions of rows and columns based on specific criteria. This method is not only flexible but also eliminates many limitations of VLOOKUP.
Syntax:
=INDEX(array, MATCH(lookup_value, lookup_array, [match_type]), MATCH(lookup_value, lookup_array, [match_type]))
Example Reference Table
The following reference table will be used. First Cell is at B3 (“FOOD”) and the Last Diagonal Cell is At F10 (“180”)
.webp)
Reference Table
Example: Let’s say the task is to find the cost of Masala Dosa. It is known that column 3 represents the cost of items, but the row position of Masala Dosa is not known. The problem can be divided into two steps-
Step 1: Find the Row Position
Find the position of Masala Dosa by using the formula:
=MATCH(“Masala Dosa”,B3:B10,0)
Here B3:B10 represents Column “Food” and 0 means Exact Match. It will return the row number of Masala Dosa.
Step 2: Use INDEX Function
Find the cost of Masala Dosa. Use the INDEX Function to find the cost of Masala Dosa. By substituting the above MATCH function query inside the INDEX function at the place where the exact position of Masala Dosa is required, and the column number of cost is 3 which is already known.
=INDEX(B3:F10, MATCH(“Masala Dosa”, B3:B10 , 0) ,3)

Use INDEX
Two-Way Lookup with INDEX and MATCH
In the above example, the column position for the cost was hardcoded. If you want to make the column lookup dynamic as well, use a MATCH function for the column position.
Example: Find the cost of “Masala Dosa” dynamically:
=INDEX(B3:F6, MATCH(“Masala Dosa”, B3:B6, 0), MATCH(“Cost”, B3:F3, 0))
Here B3:F3 represents Header Column.
Result: 60
Using INDEX MATCH For Advanced Lookups
One of the key advantages of INDEX and MATCH over the VLOOKUP function is the ability to perform a “left lookup”. It means it is possible to extract the row position of an item from using any attribute at right and the value of another attribute in left can be extracted.
For Example, Let’s say buy food whose cost should be 140 Rs. Indirectly we are saying buy “Biryani”. In this example, the cost Rs 140/- is known, there is a need to extract the “Food”. Since the Cost column is placed to the right of the Food column. If VLOOKUP is applied it will not be able to search the left side of the Cost column. That is why using VLOOKUP it is not possible to get Food Name.
1. Left Lookup with INDEX and MATCH
The INDEX MATCH combination can perform a left lookup, which is not possible with VLOOKUP.
Example: Find the food item where the cost is 140
.
Step 1: Extract Row Position
First extract row position of Cost 140 Rs using the formula:
=MATCH(140, D3:D10,0)
Here D3: D10 represents the Cost column where the search for the Cost 140 Rs row number is being done.
Step 2: Use INDEX Function
After getting the row number, the next step is to use the INDEX Function to extract Food Name using the formula:
=INDEX(B3:B10, MATCH(140, D3:D10,0))
Here B3:B10 represents Food Column and 140 is the Cost of the food item.
Result: Biryani

Cost Displayed
2. Case-Sensitive Lookup
The MATCH function is not case-sensitive by default. To perform a case-sensitive lookup, use the EXACT function in combination with INDEX.
By itself, the MATCH function is not case-sensitive. This means if there is a Food Name “DHOKLA” and the MATCH function is used with the following search word:
- “Dhokla”
- “dhokla”
- “DhOkLA”
All will return the row position of DHOKLA. However, the EXACT function can be used with INDEX and MATCH to perform a lookup that respects upper and lower case.
Exact Function: The Excel EXACT function compares two text strings, taking into account upper and lower case characters, and returns TRUE if they are the same, and FALSE if not. EXACT is case-sensitive.
Examples:
- EXACT(“DHOKLA”,”DHOKLA”): This will return True.
- EXACT(“DHOKLA”,”Dhokla”): This will return False.
- EXACT(“DHOKLA”,”dhokla”): This will return False.
- EXACT(“DHOKLA”,”DhOkLA”): This will return False.
Example: Let say the task is to search for the Type Of Food “Dhokla” but in Case-Sensitive Way. This can be done using the formula-
=INDEX(C3:C10, MATCH(TRUE , EXACT(“Dhokla”, B3:B10) ,0))
Here the EXACT function will return True if the value in Column B3:B10 matches with “Dhokla” with the same case, else it will return False. Now MATCH function will apply in Column B3:B10 and search for a row with the Exact value TRUE. After that INDEX Function will retrieve the value of Column C3:C10 (Food Type Column) at the row returned by the MATCH function.

Use Function >>Preview Results
3. Multiple Criteria Lookup
One of the trickiest problems in Excel is a lookup based on multiple criteria. In other words, a lookup that matches on more than one column at the same time. In the example below, the INDEX and MATCH function and boolean logic are used to match on 3 columns-
- Food.
- Cost.
- Quantity.
To extract total cost.
Example: Let’s say the task is to calculate the total cost of Pasta where
- Food: Pasta.
- Cost: 60.
- Quantity: 1.
So in this example, there are three criteria to perform a Match. Below are the steps for the search based on multiple criteria-
Step 1: Match the Food Column
First match Food Column (B3:B10) with Pasta using the formula:
“PASTA” = B3:B10
This will convert B3:B10 (Food Column) values as Boolean. That Is True where Food is Pasta else False.
Step 2: Match Cost
After that, match Cost criteria in the following manner:
60 = D3:D10
This will replace D3:D10 (Cost Column) values as Boolean. That is True where Cost=60 else False.
Step 3: Match Third Criteria
Next step is to match the third criteria that are Quantity = 1 in the following manner:
1 = E3:E10
This will replace E3:E10 Column (Quantity Column) as True where Quantity = 1 else it will be False.
Step 4: Multiply the Results
Multiply the result of the first, second, and third criteria. This will be the intersection of all conditions and convert Boolean True / False as 1/0.
Step 5: Use MATCH Function
Now the result will be a Column with 0 And 1. Here use the MATCH Function to find the row number of columns that contain 1. Because if a column is having the value 1, then it means it satisfies all three criteria.
Step 6: Use INDEX Function
After getting the row number use the INDEX function to get the total cost of that row.
=INDEX(F3:F10, MATCH(1, (“Pasta”=B3:B10) * (60=D3:D10) * (1=E3:E10) , 0 ))
Here F3:F10 represents the Total Cost Column.

F3 represents the Total column
4. Using INDEX and MATCH Across Different Sheets
To retrieve data from a different sheet, simply reference the sheet name.
To use the INDEX and MATCH functions across different sheets in Excel, you simply need to reference the sheet name in the formula. This method allows you to search for data in one sheet and return it to another, making it a powerful tool for multi-sheet data analysis.
Basic Syntax for INDEX and MATCH Across Sheets
=INDEX(SheetName!Range, MATCH(LookupValue, SheetName!LookupRange, MatchType))
- Sheet1 (where you want to display the result).
- Sheet2 (where the data is stored).
Step 1: Set up your Data on Sheet2
In Sheet2, you have a table with names and scores:

Enter the Data in Sheet 2
Step 2: Write the Formula on Sheet1
In Sheet1, let’s say you want to look up the score for “Jordan” from Sheet2.
Go to Sheet1 where you want the result to display.
Click in the cell where you want the result (e.g., cell A1).
Type the formula as follows:
=INDEX(Sheet2!B2:B6, MATCH(“Jordan”, Sheet2!A2:A6, 0))
- Sheet2!B2:B6 is the range where the scores are stored on Sheet2.
- MATCH(“Jordan”, Sheet2!A2:A6, 0) searches for “Jordan” in the A column on Sheet2 and returns the row position.
- INDEX then uses this row position to find Jordan’s score in the B column on Sheet2.
Step 3: Press Enter to see the result
In this example, you should get 88, which is Jordan’s score.

INDEX and MATCH Function in Excel Tutorial
Advantages of INDEX and MATCH
- Flexibility: Can perform lookups in any direction (left, right, up, or down).
- Dynamic: Adjusts dynamically to changes in data structure.
- Case-Sensitive Lookup: Possible with the help of the EXACT function.
- Handles Multiple Criteria: Ideal for complex lookups with multiple conditions
Also Read
Conclusion
Mastering the INDEX and MATCH functions opens up a world of possibilities for advanced data lookup in Excel. Unlike more rigid functions, this dynamic duo allows you to retrieve data from any location in a table, making it an invaluable tool for professionals handling large datasets. With this newfound knowledge, you’re ready to enhance your Excel skills, make data management easier, and boost your productivity. Start applying INDEX and MATCH in your projects today for fast, flexible, and powerful data solutions!
INDEX and MATCH Function in Excel – FAQs
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.
Is INDEX match better than VLOOKUP?
INDEX MATCH is often considered better than VLOOKUP for several reasons:
- Flexibility
- Efficiency
- Robustness
What replaces INDEX and match in Excel?
Excel has introduced the XLOOKUP function, which replaces INDEX and MATCH with a simpler and more versatile formula.
What is INDEX MATCH multiple criteria?
Using INDEX MATCH with multiple criteria allows you to search for a value based on more than one condition.
Syntax:
=INDEX(return_range, MATCH(1, (criteria1_range=criteria1)*(criteria2_range=criteria2), 0))
What is VLOOKUP and match formula in excel with example?
Combining VLOOKUP with MATCH enhances VLOOKUP by making the column index dynamic.
Basic Syntax: =VLOOKUP(lookup_value, table_array, MATCH(lookup_column, column_range, 0), [range_lookup])