In this article, you will learn how to use the MATCH formula in Google Sheets. This function is beneficial when you want to know a relative position of an item in a specific range.
The generic formula is as follows:
This function is useful if you want to find a relative position of an item in a particular range.
Search_key: This is a value whose relative position you want to find in a range
Range: This is a range in which you want to know the relative position of the “search_key” This range should be one-dimensional - a row or a column.
[search_type]: This is the optional input. You can input 1, 0, or -1. If you enter nothing, the formula assumes 1 is entered. Each number has the following effect on the formula’s search.
1: If you enter “1”, the formula looks for the largest value less than or equal to the “search_key” when the range is sorted in ascending order.
0: This is for an exact match. You can use this when the data set is unsorted.
-1: With this number, the formula tries to find the lowest value larger than or equal to the “search_key” when the range is sorted in descending order.
Imagine you are a finance manager and want to know the relative locations of specific items, “Apr 2022” and “Profit” in the data set in the picture below. More specifically, you need to know which column the data for “Apr 2022” is and which row the “Profit” data is.
The relative location of “Apr 2022” in the selected range
The assumptions in the formula in the picture above are as follows:
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 in the selected range. Note that the function does not give the Google Sheets’ row index.
The relative position of “Profit” in the chosen array
The assumptions in the function in the screenshot above are as follows:
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 in the selected range. Note that the function does not give the Google Sheets’ column index, either.
Check this article to learn what INDEX/MATCH is and how to use it in a practical situation.
One of its alternatives is the XMATCH function. The formula provides the same search function with more flexible search methods.
One of the ways to find the same data is to use Conditional Formatting. Check this article to learn how to highlight duplicates in a data set.
If you don’t get the right answer to your question in this article or you have other questions on lookup formulas, you may find the answers in the following articles.
Are you learning this formula to process financial data, build a financial model, or conduct financial analysis? If so, LiveFlow may help you to automate manual workflows and keep numbers updated in real time. For instance, you can easily compare your Budget versus Actual without any manual work. Furthermore, you can access other templates here, from the simple Income Statement and Operational KPI templates to Multi-Currency Consolidated Income Statement, Balance Sheet, and Cash Flow templates. You can also customize these templates as you want without breaking the automated data inflow.
To learn more about LiveFlow, book a demo.
Learn how to do this step-by-step in the video below 👇