How to Use the MATCH Function in Google Sheets (With Examples)

Published on

The MATCH function in Google Sheets returns the relative position of a value within a list or range. The relative position refers to where an item appears inside the specified range, not its actual row or column number in the sheet.

Quick Answer

MATCH searches for a value and returns its position in a list. It is commonly used with INDEX to look up related values dynamically—MATCH returns the relative position, while INDEX returns the value at that position.

What Is the MATCH Function Used For in Google Sheets?

The MATCH function in Google Sheets is used to:

  • Find the position of a value in a list
  • Return row numbers (vertical search)
  • Return column numbers (horizontal search)
  • Build dynamic lookup formulas with INDEX or FILTER

Tip: When combined with INDEX, MATCH becomes a powerful alternative to VLOOKUP and HLOOKUP.

MATCH Function Syntax

MATCH(search_key, range, [search_type])

Arguments Explained

  • search_key
    The value you want to find (text, number, or date).
  • range
    A one-dimensional range to search (single row or column).
  • search_type (optional)
    Controls how the MATCH function finds the result.
    If omitted, the default value is 1.
ValueWhen to UseBehavior
0Unsorted rangeExact match
1Sorted ascendingLargest value ≤ search_key
-1Sorted descendingSmallest value ≥ search_key

⚠️ Common mistake: Using 1, -1, or omitting the last argument on an unsorted range can return incorrect results.

MATCH Function in an Unsorted Range (Exact Match)

This is the most common use case for the MATCH function in Google Sheets. Always use 0 for exact matching.

Example: Text Search

To find the position of “Coverall” in C2:C12:

=MATCH("Coverall", C2:C12, 0)

Or using a cell reference:

=MATCH(J2, C2:C12, 0)

Result: 2 (because “Coverall” appears in cell C3)

MATCH function in Google Sheets showing an exact text match to find the position of a value in a column

Notes

  • Returns the first match if duplicates exist
  • Use C:C instead of C2:C12 to get the row number
  • Returns #N/A if no match is found

Handling #N/A Errors

You can use the IFNA function to handle #N/A errors and return an empty cell or a custom value instead.

=IFNA(MATCH(J2, C2:C12, 0))

If you want to show a custom message, you can use:

=IFNA(MATCH(J2, C2:C12, 0), "Not found")

MATCH with Numbers

To find the position of 1460 in F2:F12:

=MATCH(1460, F2:F12, 0)

Or:

=MATCH(J6, F2:F12, 0)
Using the MATCH function in Google Sheets to find the position of a numeric value in a range

MATCH with Dates in Google Sheets

If the search key is a cell reference, no extra steps are needed:

=MATCH(J10, B2:B12, 0)

If the date is hard-coded, always use the DATE function:

=MATCH(DATE(2017,10,22), B2:B12, 0)

This avoids date-format mismatches.

MATCH function in Google Sheets matching a date value using the DATE function for accurate results

MATCH Function in a Sorted Range

Ascending Order Example

Range: 1, 5, 6, 10, 15
Search key: 8

=MATCH(8, A1:A5, 1)

Result: 3
(Largest value ≤ 8 is 6)

Descending Order Example

Range: 15, 10, 6, 5, 1
Search key: 8

=MATCH(8, A1:A5, -1)

Result: 2
(Smallest value ≥ 8 is 10)

MATCH with FILTER in Google Sheets

The MATCH function can return multiple results when used with ARRAYFORMULA.

=ARRAYFORMULA(MATCH(A1:A7, F1:F2, 0))
MATCH function in Google Sheets returning multiple positions using ARRAYFORMULA for multiple search keys

To filter corresponding values:

=FILTER(B1:B7, MATCH(A1:A7, F1:F2, 0))

This returns only rows where matches exist.

Using MATCH Inside INDEX (Most Important Use Case)

The most practical use of the MATCH function in Google Sheets is inside INDEX.

Example Table

ItemPrice
Apple5
Orange4.5
Mango5.25
Banana3.25
Pineapple4.75
Grape6

Formula:

=INDEX(B1:B6, MATCH("Grape", A1:A6, 0))

Result: 6

This creates a dynamic lookup that doesn’t break when rows are inserted or deleted.

Related: Index-Match: Better Alternative to Vlookup and Hlookup in Google Sheets

Horizontal MATCH Example

If values are in C1:Q1:

=MATCH("Sales", C1:Q1, 0)

To return the column number, use:

=MATCH("Sales", 1:1, 0)

MATCH vs XMATCH in Google Sheets

Google Sheets now includes XMATCH, which adds several advanced capabilities:

  • Supports reverse searches
  • Supports wildcards
  • Uses binary search for faster lookups on sorted data
  • Replaces many advanced MATCH use cases

However, the MATCH function in Google Sheets is still widely used because it is simpler, faster, and sufficient for most lookup scenarios.

Final Thoughts

The MATCH function in Google Sheets is essential for:

  • Exact lookups
  • Dynamic row and column detection
  • Advanced formulas using INDEX and FILTER

If you master MATCH, you unlock the real power of spreadsheet automation.

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Expert Prashanth KV is a Diamond Product Expert in Google Sheets, officially recognized by Google for his contributions to the Docs Editors Help Community and featured in the Google Product Experts Directory. Explore his blog to learn advanced formulas, automation tips, and problem-solving techniques to elevate your spreadsheet skills.

Top Discussions

More like this

Pivot Table Formatting, Output & Special Behavior in Google Sheets

Pivot Tables in Google Sheets are powerful—but they can get tricky once you move...

Pivot Table Calculations & Advanced Metrics in Google Sheets

When it comes to built-in tools for data analysis and visualization in Google Sheets,...

Google Sheets Pivot Table Tutorial: Basics, Setup, and Date Grouping

The easiest way to summarize, analyze, and report data in Google Sheets is by...

2 COMMENTS

  1. Hi Prashanth 🙂

    I would like to ask you regarding MATCH function.

    If I have 2 tables with the same name and column such as :-
    TABLE A : [Name, Age, Address] TABLE B : [Name, Age, Address]

    I want to make another table (TABLE C-with the same column & name) , to combine both data in the new table. But, if the row in TABLE A is match with TABLE B, it will take only one row instead of taking both rows (if it takes both, the data is redundant).

    Is it possible to use MATCH or any other formula for it?

    Thank you so much 🙂

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.