How to Use the MATCH Function in Google Sheets

Video google sheet match

Have you ever wanted to find the relative position of an element in a specific range in Google Sheets? In this article, we will explore the power of the MATCH formula and how it can help you achieve just that!

Understanding the MATCH Formula

The MATCH formula in Google Sheets is an essential tool when you need to determine the relative position of an element within a specific range. Let’s dive into how to use it.

  1. Type “=MATCH” or go to “Insert” -> “Function” -> “Lookup & Reference” -> “MATCH”.
  2. Enter the “search key” either manually or by referencing a cell.
  3. Select the range in which you want to find a match for the “search key”.
  4. Set the search mode if necessary.

Insert the MATCH function from the menu bar in Google Sheets

The generic formula for the MATCH function is as follows:

MATCH(search_key, range, [search_type])

Let’s break down the components of the formula:

  • “search_key” is the value you want to find the relative position of within a range.

  • “range” is the range in which you want to determine the relative position of the “search_key”. This range should be one-dimensional, either a row or a column.

  • “[search_type]” is an optional input. You can enter 1, 0, or -1. If you don’t enter anything, the formula assumes 1. Each number has the following effect on the search:

    • 1: If you enter “1”, the formula searches for the largest value less than or equal to the “search_key” when the range is sorted in ascending order.
    • 0: This corresponds to an exact match. You can use this when the dataset is not sorted.
    • -1: With this number, the formula tries to find the smallest value greater than or equal to the “search_key” when the range is sorted in descending order.

Let’s take an example. Imagine you are a financial manager and you want to know the relative positions of specific items, “Apr. 2022” and “Profit”, within the dataset shown below. Specifically, you need to know which column “Apr. 2022” data is in and which row “Profit” data is in.

The relative location of "Apr. 2022" in the selected range

Assuming the following in the formula:

  • “search_key”: B11 (“Apr. 2022”)
  • “range”: C2:H2 (a row)
  • “[search_type]”: 0 – an exact match

The formula returns 4 because “Apr. 2022” is in the fourth column of the selected range. Note that the function does not provide the row index in Google Sheets.

The relative position of "Profit" in the selected table

Assuming the following in the formula:

  • “search_key”: B12 (“Profit”)
  • “range”: B3:B8 (a column)
  • “[search_type]”: 0 – an exact match

The formula returns 5 because “Profit” is in the fifth row of the selected range. Similarly, the function does not provide the column index in Google Sheets.

Troubleshooting the MATCH Formula

Sometimes, the MATCH formula may not work as expected. Here are a few common issues and their solutions:

  • No exact match: When you enter 0 for “search_type” in the formula, there is no exact match. Extra spaces contained in “search_type” or the target value can prevent a correct exact match.
  • Incorrect range selection: You might have chosen the wrong range for the search in the formula.
  • Format mismatch: The format of the value you’re trying to find the relative position of differs from that of the “search_key”.
  • Unsorted data: When choosing “1” or “-1” for “search_type”, the range you select must be sorted according to the chosen search method – ascending order for 1 and descending order for -1.

Take It to the Next Level with INDEX/MATCH

If you want to unleash even more power in Google Sheets, consider using the INDEX/MATCH combination. Check out our article on Crawlan.com to learn what INDEX/MATCH is and how to use it in practical situations.

Exploring Alternatives to the MATCH Formula

Looking for alternatives to the MATCH formula? One such alternative is the XMATCH function. This formula offers the same search functionality with more flexible search methods.

Finding Duplicate Data in Google Sheets

If you’re looking to find duplicate data in Google Sheets, one way is to use conditional formatting. Check out our article on Crawlan.com to learn how to highlight duplicates in a dataset.

Ready to master the MATCH function? Visit Crawlan.com to discover more Google Sheets tips and tricks!

Crawlan.com

Related posts