All resources

How to Use INDEX MATCH in Google Sheets: A Complete Guide

Did you know that over 80% of spreadsheet users rely solely on VLOOKUP for data retrieval? Yet, the INDEX and MATCH functions offer more flexibility and power for managing complex data. While many users rely on Google Sheets' VLOOKUP for basic lookups, using INDEX MATCH offers a more dynamic and adaptable alternative for advanced data retrieval. 

This step-by-step guide will explore how to master these underutilized functions in Google Sheets, enabling you to access and manipulate your data with precision and accuracy in a dynamic manner.

i-radius

Whether you’re a data analyst, project manager, or a spreadsheet enthusiast building reports to track progress and maintain control of your tasks, understanding these functions can significantly boost your workflows and increase efficiency. Let’s dive into the practical applications of INDEX and MATCH and discover new levels of productivity in your spreadsheet tasks.

Mastering the INDEX and MATCH functions in Google Sheets is important for efficient data management. Learn how to take advantage of these powerful tools, including the index match function for advanced lookups, to access and manipulate your data with precision dynamically.

Introduction to INDEX and MATCH Functions in Google Sheets

The INDEX and MATCH functions in Google Sheets are great for handling more complex lookups and data analysis. When used together, they offer more flexibility than functions like VLOOKUP or HLOOKUP.

INDEX returns the value of a cell based on the row and column numbers you specify. This allows you to pull information from any part of your data range.

MATCH finds the position of a specific value in a row or column. When combined with INDEX, it allows you to create dynamic lookups, including horizontal lookups, which is especially useful when your data is organized across columns rather than down rows.

Exploring the INDEX Function

The INDEX function is a powerful tool, often referred to as the index formula in Google Sheets, that returns the value of a cell within a specified range based on given row and column numbers. 

When using the INDEX formula and INDEX MATCH, it is essential to specify the correct cell reference to ensure accurate data retrieval. It enables users to dynamically access specificdata points within large datasets, thereby enhancing data management and analysis.

Syntax of INDEX Function

The syntax of the INDEX function in Google Sheets is:

=INDEX(reference, [row], [column])

Let's break it down:

  • reference: The range of cells from which you want to retrieve a value.
  • row: (Optional) The row number in the range from which to retrieve the value.
  • column: (Optional) The column number in the range from which to retrieve the value.

Example of INDEX Function

For instance, we need to find out the value of the cell in the eighth row and second column of the cell. Let's apply this formula:

=INDEX(B3:D11, 8, 2)
Overview of INDEX function in Google Sheets for flexible data retrieval. i-border

The function will return the value "34" in the 8th row and the 2nd column of the specified range B3:D11.

Understanding the MATCH Function

The MATCH function in Google Sheets searches for a specified value in a range and returns the relative position of that value. The match function returns the position of the specified search key within the given range, allowing you to identify exactly where the value appears. It’s commonly used to find the row or column number where the value is located, making it a valuable tool for dynamic data retrieval and analysis.

Syntax of MATCH Function

The syntax of the MATCH function in Google Sheets is:

=MATCH(search_key, range, [search_type])

Let's explain:

  • search_key: The value to find in the range.
  • range: The range of cells to search within.
  • search_type: (Optional) Specifies the search mode (1 for ascending, 0 for exact match, -1 for descending).

Example of MATCH Function

Let's say you need to find a cell with "iPad" text in the range from B3 to B11:

=MATCH("iPad", B3:B11, 0)
Basic explanation of MATCH function in Google Sheets with example. i-border

If "iPad" is in cell B8, the function will return 6, indicating its position within the specified range B3:B11.

Why Use INDEX & MATCH as an Alternative of VLOOKUP?

INDEX and MATCH offer greater flexibility and efficiency compared to VLOOKUP. Unlike VLOOKUP, which requires the lookup value to be in the first column, INDEX and MATCH can search anywhere in the dataset. They also handle large datasets better by avoiding unnecessary recalculations.

Additionally, INDEX and MATCH can look up values to the left or right of the search column, providing more versatile data retrieval options. This combination reduces errors, supports exact match lookups, and enhances spreadsheet performance. When set up correctly, both INDEX and MATCH, as well as VLOOKUP, can produce the same result. However, INDEX and MATCH offer more versatility, especially with different search types and data arrangements.

💡While INDEX and MATCH offer flexibility in data searches, VLOOKUP remains a favorite among data analysts, project managers, and business owners for its ease of use. Mastering the VLOOKUP function can provide essential skills for quickly retrieving data. Dive deeper with our comprehensive guide to VLOOKUP, enhancing your data analysis toolkit.

Step-by-Step Guide to Using INDEX & MATCH Functions

Struggling to synchronize data across different sheets efficiently? This section guides you through a clear, four-step process to integrate the INDEX and MATCH functions. These steps offer more control than the traditional VLOOKUP function, especially when working with variable data structures.

In the following example, we will demonstrate how to use INDEX and MATCH together for efficient data lookups.

Step 1: Identify the Lookup Range and Selection Criteria

Initially, we need to determine the lookup table range, the lookup value, and the output column

Step-by-step process of using INDEX and MATCH functions in Google Sheets for data lookups. i-border

In this example, the ‘Item’ values in column F will serve as our lookup values. Specifically, each value in column F (such as 'Apple TV' in cell F3) acts as the search key in the MATCH function to find the correct row in the lookup table. We’ll utilize the range B3:D11 as our lookup table. Finally, we want to retrieve the corresponding quantity count for each item name that matches.

Step 2: Implement the MATCH Function to Locate Data

Select the cell where you wish to display the lookup result, and start typing ‘=MATCH’ to start the MATCH function. The MATCH function tells Google Sheets which value to look for and where to search. For our example, the first argument of the MATCH function should be the lookup value, ‘Apple TV’, located in cell F3.

Example of setting up MATCH function in Google Sheets for precise data extraction. i-border

Then, set the lookup range, which in this case is B3:B11. This range should be a one-dimensional array to avoid errors.

Detailed walkthrough of MATCH function in Google Sheets for advanced lookups. i-border

The third argument determines the search type to use.

  • A value of ‘1’ means the range is sorted in ascending order, and we want to return the largest value that is less than or equal to the lookup value.
  • A value of ‘-1’ suggests the range is sorted in descending order, and the function will return the smallest value that is greater than or equal to the lookup value.
  • A value of ‘0’ is used for an exact match, which is necessary when the lookup range is unsorted.

The formula will output the row number where the item is found:

=MATCH(F3, B3:D11, 0)
Applying MATCH function in Google Sheets to return specific values from a dataset. i-border

Step 3: Wrap MATCH Function with INDEX Function

Next, we’ll wrap the MATCH function within an outer INDEX function to combine the index and MATCH for advanced lookups.

Let’s break down the arguments:

  • The first argument of the INDEX function should be the range of the lookup table, from which we want to pull data.
  • The MATCH function, as outlined in the previous step, will serve as the second argument for the INDEX function. By combining the INDEX and MATCH functions, you can enhance data retrieval flexibility, support exact match conditions, and work with multiple criteria.
  • The third argument would specify which column in the lookup table to return data from if needed.
Structure of the INDEX and MATCH formula in Google Sheets for accurate data queries. i-border

The result of the MATCH function effectively becomes the row number from which the INDEX function retrieves the value.

Here’s how the index match formula is structured: The INDEX function retrieves a value from a specified range, while the MATCH function locates the position of the lookup value. Together, the index match formula allows for dynamic and precise data lookups.

=INDEX(B3:D11, MATCH(F3, B3:B11, 0),2)

Step 4: Convert Lookup Ranges to Absolute References

The final step involves converting the lookup table ranges to absolute references. This ensures that when you drag the formula down to fill other cells in the column, the references in the formula remain unchanged, which is especially useful when working within the same sheet to maintain consistent references.

Practical example of INDEX and MATCH functions in Google Sheets for multi-column searches. i-border
Pro Tip: Using absolute references in your formulas is crucial to prevent them from shifting when dragged. By fixing the cell range in your formula, for example, changing C3:C11 to $C$3:$C$11, you anchor the cell references.

This allows you to safely drag the formula from G3 to G10, ensuring consistent data retrieval across your sheet and keep fixed references.

The final formula looks like this:

=INDEX($B$3:$D$11, MATCH(F3, $B$3:$B$11, 0),2)
Advanced use of INDEX and MATCH functions in Google Sheets to handle large datasets. i-border

By following these steps, you can efficiently synchronize data across sheets using the powerful combination of INDEX and MATCH functions, ensuring precise and reliable data management in Google Sheets.

Advanced Techniques with INDEX & MATCH Functions

Dive into advanced uses of INDEX & MATCH in this section, where you’ll explore advanced techniques that leverage these tools for multi-criteria searches, cross-sheet data integration, and even setting up a mini search bar within your sheets. You’ll gain hands-on knowledge to perform data operations, enhancing your efficiency and analytical capabilities.

Creating a Mini Search Bar with INDEX and MATCH

In Google Sheets, suppose you want to quickly find the quantity of a sold item using a search bar. Creating a Mini Search Bar with INDEX and MATCH involves setting up a cell where users input search criteria, with the MATCH creating a link between the search input and its position in the dataset.

INDEX retrieves the result based on the MATCH function, which finds the position of the search term.

Let’s find out the quantity of the sold items by creating the search cell and then applying the following formula:

=INDEX(B3:D11,MATCH(F3,B3:B11,0), 2)
Example of creating a mini search bar in Google Sheets using INDEX and MATCH functions. i-border

Let’s break it down:

  • MATCH(F3,B3:B11,0): The MATCH function searches for a value in column B that matches the input in cell F3.
  • INDEX (B3:D11: if a match is found, it retrieves the corresponding value from the second column.

Using INDEX and MATCH Functions for Cross-Sheet Data Integration

Using the INDEX and MATCH functions between sheets is straightforward. Simply add the sheet name before the data range or array where you want to search for a specific key.

Let's consider that we have a sheet with data on items and years of production, but we need to create a mini search tab for sales data using another sheet.

Here is the formula we will be using:

=INDEX('3. Creating a Mini Search Bar with INDEX and MATCH'!B3:C11, MATCH(E3, B3:B11, 0), 2)
Cross-sheet data integration in Google Sheets using INDEX and MATCH functions. i-border

Multi-criteria Searches Using INDEX and MATCH

Multi-criteria searches with INDEX and MATCH enable more precise data retrieval by considering multiple conditions. You can use INDEX and MATCH to perform lookups and match data based on multiple criteria, allowing you to filter data vertically, horizontally, or both for greater accuracy. Combine MATCH with nested IF or CHOOSE functions to evaluate several criteria.

For instance, we want to find the quantity of iPhone 13 Pro models from 2021 in the item list. Let’s use the formula:

=INDEX(C3:C11, MATCH(1, (F3=B3:B11) * (G3=D3:D11), 0))
Using INDEX and MATCH functions in Google Sheets for multi-criteria searches. i-border

Let’s break down this formula:

  • INDEX(C3:C11, …): This function is designed to return the value from the ‘Quantity’ column.
  • MATCH(1, (F3=B3:B11) * (G3=D3:D11), 0): This demonstrates how to match with multiple criteria for more precise data retrieval, as it looks for the row where both the item and year match the criteria.
  • (F3=B3:B11) checks for the item match, and (G3=D3:D11) checks for the year match.
  • The multiplication acts like an AND operation in this context. This logic is commonly used in an ARRAY FORMULA, where MATCH looks for ‘1’ representing a TRUE value for both conditions.

This approach provides a reliable solution for complex data scenarios where exact match or single-criteria lookups fall short, especially when you need to match with multiple criteria.

Dynamic Data Retrieval with INDEX and MATCH

One of the key advantages of the approach we’ve taken is its dynamic nature. By leveraging drop-down lists, we’ve essentially created an interactive lookup system that allows us to retrieve quantity figures for different items and production years.

To set this up, go to Data → Data Validation, click on “Data Validation.”

Dynamic data retrieval in Google Sheets using INDEX and MATCH functions. i-border

Then choose the “Criteria” option from the dropdown menu. In the “Criteria” window, select “Dropdown (from a range)” from the “Criteria” dropdown.

Setting up dynamic data lookups in Google Sheets with INDEX and MATCH functions. i-border

This will enable you to select the column and automatically add all the criteria.

Now, cell F3 should display a drop-down arrow. When you click on it, you’ll see a list of the available items from your dataset. Now repeat the process in cell G3 and create a drop-down list of years.

Retrieving data dynamically with INDEX and MATCH functions in Google Sheets. i-border

Making dropdown menus for 'Item' and 'Year,' we can create an easy selection of criteria that we can efficiently then use in this formula:

=INDEX(C:C, MATCH(1, (B:B=F3)*(D:D=G3), 0))

Specifically:

  • MATCH(1, (B:B=F3): searches for a match where the value in column B equals the value in cell F3 and the value in column D equals the value in cell G3.
  • INDEX(C:C: if a match is found, it retrieves the corresponding value from column C.
Shows dynamic queries in Google Sheets using INDEX and MATCH functions. i-border

Applying INDEX and MATCH for Case-Sensitive Vertical Lookup

To perform a case-sensitive VLOOKUP in Google Sheets, use the combination of INDEX and MATCH with an ARRAYFORMULA and EXACT. The EXACT function helps in distinguishing between different cases. Note that we mark used and refurbished items with lowercase letters. To look up the year for a case-sensitive match of "macbook air" from the search item in cell E3 in the table, we can use the following formula in cell F3:

=INDEX(C3:C11, MATCH(TRUE, ARRAYFORMULA(EXACT(B3:B11, E3)), 0))
Performing case-sensitive lookups in Google Sheets with INDEX and MATCH functions. i-border

Here's the breakdown:

  • EXACT(B3:B11, E3): creates an array of TRUE and FALSE values, where each element indicates whether the corresponding item in column B exactly matches the search item in E3.
  • ARRAYFORMULA(EXACT(B3:B11, E3)): ensures that the EXACT function is applied to the entire range.
  • MATCH(TRUE, ARRAYFORMULA(EXACT(B3:B11, E3)), 0): finds the position of the first TRUE in the array, which corresponds to the row where the exact match is found.
  • INDEX(C3:C11, ...): retrieves the year from the 'Year' column corresponding to the matched position.

Addressing Typical Errors with INDEX & MATCH Functions

Common issues with the INDEX and MATCH functions include #N/A errors resulting from unmatched lookup values, incorrect range references, and improper use of absolute or relative cell references. Understanding these errors and how to correct them ensures reliable and efficient data lookups, thereby enhancing overall spreadsheet functionality.

Incorrect Search Type in MATCH Function

⚠️ Error: Using an incorrect search type in the MATCH function can lead to inaccurate or unexpected results. The MATCH function's third argument specifies the match type: 1 for less than, 0 for exact match, and -1 for greater than. Incorrectly setting this value can cause the function to return incorrect positions or #N/A errors.

Solution: Ensure the correct match type is used for your specific need. For most exact lookups, use 0:

=MATCH(lookup_value, lookup_array, 0)

This ensures that the function returns the exact position of the lookup value in the array.

Blank Cells in Lookup Range

⚠️ Error: Blank cells in the lookup range can cause the MATCH function to return incorrect positions or #N/A errors. This occurs because MATCH may interpret blank cells as zeros or fail to find the lookup value.

Solution: Ensure the lookup range does not contain blank cells. You can use the IF function to handle potential blanks:

=MATCH(lookup_value, IF(lookup_array="", "N/A", lookup_array), 0)

This formula replaces blank cells with a placeholder text, avoiding misinterpretation and ensuring accurate matches.

Incorrect Lookup Range Provided

⚠️ Error: Providing an incorrect lookup range in the MATCH function can lead to inaccurate results or #N/A errors. This occurs when the specified range doesn't match the intended data set or spans unintended cells.

Solution: Double-check and correctly specify the lookup range to match the exact data set you intend to search. Ensure the range covers all relevant cells:

=MATCH(lookup_value, correct_lookup_range, 0)

This ensures the function searches within the intended data range, returning accurate positions.

Wrong Named Range Used

⚠️ Error: Using a wrong-named range in the MATCH function can lead to incorrect results or #N/A errors. This happens when the named range doesn't refer to the correct data set or is misspelled.

Solution: Ensure the named range is correctly defined and refers to the appropriate data set. Verify the spelling and scope of the named range to ensure accurate results.

Reference Cells Not Locked

⚠️ Error: Not locking reference cells in the MATCH function can lead to errors when copying the formula across cells. This occurs because relative cell references change based on the formula's position, causing incorrect results.

Solution: Use absolute references by adding dollar signs ($) to lock the reference cells. This ensures the lookup range remains constant, providing accurate results when the formula is copied to other cells.

Best Practices to Apply INDEX and MATCH

Applying best practices to the INDEX and MATCH functions ensures accurate and efficient data retrieval. Key practices include correctly specifying one-dimensional array ranges, handling errors, locking reference cells, and using exact match types. These methods enhance reliability and prevent common pitfalls in spreadsheet lookups.

Non-adjacent Lookups

Non-adjacent lookups with INDEX and MATCH involve retrieving data from a range that isn't directly next to the lookup column. By combining MATCH to find the row position and INDEX to reference a different column, you can efficiently search and retrieve data from non-adjacent ranges, providing flexible data handling.

Leveraging Flexibility

Leveraging the flexibility of the INDEX and MATCH functions allows for dynamic and versatile data retrieval. Unlike VLOOKUP, INDEX and MATCH can search both vertically and perform a horizontal lookup, handle non-adjacent columns, and don't require the lookup column to be on the left. This flexibility enhances data management, making it easier to adapt to various spreadsheet structures and requirements.

Adapting to Dynamic Data Ranges

To adapt to dynamic data ranges with INDEX and MATCH in Google Sheets, use named ranges or dynamic references. For example, instead of using static cell references, use a named range or a formula like:

=INDEX(A:A, MATCH(lookup_value, B:B, 0))

This type of application ensures your formula adjusts automatically as data ranges change.

Preventing Problems with Sorted Data

To prevent problems with sorted data, ensure formulas using INDEX and MATCH are designed to handle dynamic data. For example, avoid hard-coding cell ranges and use dynamic ranges or named ranges instead. When sorting, confirm that your lookup values are correctly matched to avoid errors due to shifted data. The benefit of using INDEX and MATCH over the VLOOKUP function is that they do not require sorting the data, providing greater flexibility.

Enhance Your Data Analysis Using Formulas in Google Sheets

Google Sheets offers a range of robust formulas designed to simplify your data analysis tasks.

  • Query Function: Executes complex SQL-like queries within Google Sheets, allowing for detailed data manipulation and retrieval.
  • Array Formulas: Enables the performance of multiple calculations over an array of cells, applying a formula to entire columns or rows simultaneously.
  • Filter Function: The Filter Function filters out rows in a dataset based on specified conditions, returning only those that meet the specified criteria.
  • Pivot Tables: Creates comprehensive summaries from extensive data sets, organizing and comparing distinct values effectively.
  • If Function: Evaluates a condition and returns one value if true and another if false, useful for creating conditional formulas.
  • ImportRange: Allows data to be imported from one spreadsheet to another, facilitating the sharing and manipulation of data across multiple files.
  • Unique Function: Identifies and returns unique rows within a specified data range, eliminating duplicate entries.
  • Search Function: Locates and returns the position of a text string within another text string, which can be case-sensitive.

Visualize Your Data with OWOX: Reports, Charts & Pivots Extension

Use the OWOX: Reports, Charts & Pivots extension to connect BigQuery with Google Sheets and quickly build dynamic pivot tables and visual reports. It helps you manage your data more efficiently, automate imports, and turn raw numbers into useful insights.

FAQ

What are the INDEX and MATCH functions in Google Sheets?
How do you combine the INDEX and MATCH functions for data retrieval?
What are some advanced techniques for using INDEX MATCH in Google Sheets?
What is the difference between VLOOKUP and INDEX match in Google Sheets?
How can you apply best practices when using INDEX MATCH?

You might also like

2,000 companies rely on us

Oops! Something went wrong while submitting the form...