How to Use MATCH Function in Google Sheets (2 Scenarios)

In Google Sheets, if you want to track the position or serial of any specific value in a range, the MATCH function will be helpful. This article will show you how to use the MATCH function in Google Sheets.


A Sample of Practice Spreadsheet

You can download spreadsheets from here and practice.


What Is MATCH Function in Google Sheets?

The MATCH function is fairly basic in google sheets. It only returns the serial number, not the specific value. The search value can be a text, a number, or data.

Syntax

The following is the syntax for the MATCH function:

=MATCH(search_key, range, search_type)

syntax for match function in google sheets

Arguments

The arguments of the MATCH function are as follows:

ARGUMENT REQUIREMENT FUNCTION
search_key Required The specific value that you want to look up.
range  Required  A set of data whether a column or a row from where the specific value can look up.
search_type Optional It allows Google Sheets about the arrangement of the range to make the search faster.

1: applicable for the ascending order range

0: applicable for both sorted and unsorted data.

-1: applicable for descending order range.

Output

The formula =MATCH(“Robert”,C5:C9,0) will look for the relative position of the text value, and it returns ‘3’ as output which means the value is in the third cell of the range.


2 Suitable Scenarios to Use MATCH Function in Google Sheets

You can look up the position of any specific value from both sorted and unsorted data ranges.

1. Working with Unsorted Data

By inserting numeric, text, and date values in an unsorted data range, you can easily locate the relative position of the desired value. Here, we develop a dataset containing Employee ID, Employee Name, and Joining Date. We also create a value cell where you put your search key and can apply the MATCH function in the position cell to find the position of the value.

dataset for match function

1.1 With Numeric Value

If you want to find the location of a numeric value,

  • First, insert a numeric value for the search key. Here we input employee ID 1126 as our search key.

add search key in the function

  • Now in the position cell apply the MATCH function.

apply match function in google sheets

  • Insert the G4 cell as the first argument of the function.

add search key in the function

  • After that add the range in the function. Here, we insert the entire Employee ID column as a range.

add range for the function

  • As search_type we add “0” to get the correct result. It is because of the unsorted nature of the data range.

input zero to get exact result

  • Finally, press ENTER and you will find the position of your desired value in the data range.
=MATCH(G4,B5:B9,0)

final output of match function in google sheets


1.2 With Text Value

You can also search for text value positions in the dataset. To do so,

  • First, input a text value for which position you want to search. Here we insert the employee’s name” Robert”.

add text to lookup its position

  • Then apply the MATCH function in cell G5.

insert match function

  • Now, add the G4 cell as the first parameter of the function.

insert search key in google sheets

  • Instead of a cell, you can also input the text value directly. Here, we add “Robert” as search_key.

insert specific text in the function

  • After that insert the range. We add C5:C9 for the range parameter.

input range for the function

  • At the end, add 0 to achieve the exact result.

set zero to get exact match

  • Finally, press ENTER and you will get the relative position of the text value “Robert” in the range.
=MATCH(“Robert”,C5:C9,0)

output of match function with text value


1.3 With Date Value

If you insert a date in your dataset you can apply the DATE function. The syntax for the function is:

=DATE(year,month,day)

insert date in column

To apply the MATCH function for date value,

  • At first, add a date value for which position you want to track.

look up for a date

  • Then apply the MATCH function in cell G5.

insert match function in google sheets

  • Now enter the DATE function as search_key.

add cell i the function

  • Alternatively, you can also input the cell G4 as search_key, which contains the required date.

apply the date as search key

  • After that, insert the range for the function. Here, we add the Joining Date column.

select range for the match function

  • In the end, input 0 to get the exact result.

set zero to get exact match in google sheets

  • Finally, press ENTER and the relative position of the desired text is shown in the selected cell.
=MATCH(DATE(2010,8,16),D5:D9,0)

match function with date in google sheets


2. Using Sorted Data

To look up relative position of the desired value, you can also apply a sorted data range for the MATCH function. For sorted data, in MATCH function you can use 1 or -1 along with 0 as the search_type parameter to get the exact result. Here, 1 is for ascending order data range and -1 is for descending order data range. So,

  • First, sort the range from where you want to know the relative position of your desired value. Ignore this if you already have a sorted dataset.

apply sort formula in the column

  • Here is the sorted form of the selected data range. Since it is text, it was sorted in alphabetical order.

sort data range

  • Now, add a value in cell G4 to find its relative position.

  • After that, in cell G5 insert the MATCH function.

apply match function in the cell

  • Add the G4 cell as a search key.

insert search key in google sheets

  • Then select the entire Employee Name column as a range which is C5:C9.

apply range in match function

  • In the end, insert 1 as search_type. Here we use the ascending order of the range so that we will get the exact value by adding 1 instead of 0.

insert i as it's an ascending order column

  • Finally, press Enter and you will get the exact relative position of the selected value.
=MATCH(G4,C5:C9,1)

final output of match function with sorted data

Note: You can use -1 as search_type if the data order range is in descending order

How to Use Combined INDEX MATCH Formula in Google Sheets

Though the MATCH function is a basic function, the combination of INDEX and MATCH functions is very powerful in Google Sheets. The INDEX MATCH function is considered the alternative to the VLOOKUP function and can solve many problems of lookup values.

The syntax of the INDEX function is as follows:

=INDEX(reference, row, column)

1. Single MATCH Function

To apply the INDEX MATCH function for single criteria,

  • First, select the value cell G4 to apply the formula.

select cell in google sheets

  • Then apply the INDEX function.

apply index function

  • After that add the range for the function. Here, we add the entire dataset as a range.

add the reference for the function

  • Now as a row parameter, add the MATCH function.

as row of index function insert match function

  • Then insert the search key for the MATCH function. Here we add “Robert” as a search key.

add search key

  • Add the entire Employee Name column as a range. And input 0. Close the bracket to finish the MATCH function.

insert match function

  • After that, add the column number for the INDEX function. Here, we add 1 which represents the Employee ID column.

add column number

  • Finally, press ENTER and you will find the employee ID for the employee “Robert”.
=INDEX(B5:D9,MATCH(“Robert”,C5:C9,0),1)

output of single match function in google sheets

Read More: How to Return Exact Match in Google Sheets (7 Suitable Ways)


2. Multiple MATCH Functions

We can also use multiple MATCH functions along with the INDEX function to find out desired value from complex or large datasets. To show this, we create a dataset representing monthly temperatures for different years. Here, we want to look up April 2017 temperature value.

dataset for multiple match function

  • So, first, insert the INDEX function in cell F11.

insert index function in google sheets

  • Then insert the entire dataset as a reference. Here we add C5:G9 as a reference.

add entire dataset as reference

  • Now, as the row value applies the first MATCH function where C12 is the search_key, B5:B9 represents the range and FALSE is set for getting the exact value.
MATCH(C12,B5:B9,FALSE)

add first match function as row in google sheets

  • After that, as column value apply another MATCH function where C11 represents the search_key, C4:G4 is the range, and FALSE is set to get an accurate result.
MATCH(C11,C4:G4,FALSE)

insert second match function in google sheets

  • Finally, press ENTER and you will find the desired value in the selected cell.
=INDEX(C5:G9,MATCH(C12,B5:B9,FALSE),MATCH(C11,C4:G4,FALSE))

Read More: How to Match Cells Between Two Columns in Google Sheets (6 Ideal Methods)


How to Solve ‘MATCH Function Not Working?’ in Google Sheets

  • Ensure Exact Match: You have to be careful about the exact match of the function. for instance, you will get the exact result when you add 0 for both the sorted and unsorted ranges.
  • Insert Proper Range: You have to choose the correct range to run the function properly.
  • Conscious about Format Issue: You have to be conscious about the search_key formatting because if the formatting of the value that location you want to track is not matched with the search_key, then the function shows an error.
  • Differentiate between Sorted and Unsorted Data: When you choose 0 for “search_type” you can use both sorted or unsorted data ranges. But you have to choose “1” for the ascending order range and “-1” for descending order range.

Conclusion

Hope that this article will help you to understand how to use the MATCH function in Google Sheets. To explore much deeper about different functions of Google Sheets you can visit the OfficeWheel website.

Annyca Tabassum

Annyca Tabassum

Hello, I'm Annyca Tabassum. I currently work for the SOFTEKO as a technical writer and content developer. I have completed my graduation and post-graduation from SUST.

We will be happy to hear your thoughts

Leave a reply

OfficeWheel
Logo