Contact

MATCH Function in Google Sheets: Formula, Examples & Troubleshooting

Lookup Intermediate Google Sheets

Learn the MATCH formula in Google Sheets: find the relative position of a matching key, with reproducible examples, expected answers and compatibility cautions.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: MATCH returns a relative position within one row or one column. Use search_type 0 for exact lookup in an unsorted range. Its default is 1, an approximate lookup that assumes ascending sorting.

Availability and version history

  • Introduced: Introduction version not established by the official history reviewed.
  • Availability: Documented in the rolling Google Sheets service; examples use the web spreadsheet workflow.
  • Checked: October 14, 2026; official MATCH reference. Documentation check, not a new native test; existing example-verification notes retain their scope.

Syntax and original practice data

=MATCH(search_key, range, [search_type])

Square brackets mark optional arguments and are not typed. Examples use English function names and comma separators; review File → Settings → Locale when comparing punctuation-sensitive formulas. Enter the original data below in A1:F9, with the Row column used only as an explanatory label. Amount and Units are numbers; other fields are text. Keep outputs outside the input table.

Row A · Item B · Team C · Status D · Amount E · Units F · Agent
1 Item Team Status Amount Units Agent
2 Pen East Paid 120 12 Ana
3 Pad West Pending 75 5 Bo
4 Box East Paid 210 7 Ana
5 Tape North Paid 90 0 Cy
6 Folder West Paid 150 3 Bo
7 Pen East Pending 60 8 Dee
8 Pad West Paid 125 12 Ana
9 Box North Pending 80 4 Cy

Two original worked examples and their duplicate-key scope

=MATCH("Box",A2:A9,0)
=MATCH("West",B2:B9,0)

The original independently reasoned expectations are 3 and 2, based on the first Box and first West. These formulas and their inputs are retained, but the captured dedicated MATCH text does not explicitly specify how duplicate ties are resolved. They remain first-occurrence model expectations, not newly native-certified duplicate behavior.

For an explicitly documented first-to-last search policy, XMATCH provides search_mode 1. =XMATCH("Box",A2:A9,0,1) has documented-model position 3, while last-to-first mode -1 selects position 8. That is a separate function, not evidence that every MATCH tie case is identical.

Required shape and mode meanings

range must be one-dimensional: a single row or column. Google documents an error for a two-dimensional range with both dimensions greater than one; its help text spells that error #N/A!. This guide does not infer the exact native display punctuation from that wording.

search_type Required order Selection rule
0 No sorted-order requirement Exact key
1 or omitted Ascending Largest key less than or equal to the query
-1 Descending Smallest key greater than or equal to the query

The returned number is the position of the selected key, not the key itself and not automatically its worksheet row number.

Advanced example: unique keys with an aligned result range

On a separate sheet enter A1:B5:

ID Amount
U-103 28
U-101 16
U-104 45
U-102 20
=MATCH("U-104",A2:A5,0)
=INDEX(B2:B5,MATCH("U-104",A2:A5,0),1)

Expected results are 3 and 45. U-104 is the third value within A2:A5, although it occupies worksheet row 4. The return range B2:B5 uses the same four records and the same starting row, so position three selects the corresponding amount.

Starting the return range at B1 would instead make position three select 16. The positions can be arithmetically valid while the record alignment is wrong.

Advanced example: resolve a header and a record

For the same unique-key table:

=MATCH("Amount",A1:B1,0)
=INDEX(A2:B5,MATCH("U-104",A2:A5,0),MATCH("Amount",A1:B1,0))

Expected results are 2 and 45. One MATCH chooses the record; the other chooses its field. Both positions are relative to the axes used by INDEX. Google demonstrates this two-way INDEX/MATCH pattern in its INDEX reference.

Advanced example: ascending numeric boundaries

On another sheet enter 0,10,20,50 in D2:D5.

=MATCH(35,D2:D5,1)
=MATCH(35,D2:D5)

Both have expected result 3, selecting the key 20. Queries 1,20,75 have expected positions 1,3,4. The position for 35 is not the boundary value 20; use INDEX if you need the associated label or value.

This mode selects a lower boundary, not whichever boundary has the smallest absolute distance. Do not assume the same result when the source is unsorted.

Advanced example: descending upper boundaries

Enter 50,20,10,0 in F2:F5. With =MATCH(query,F2:F5,-1), queries 35,15,5,20 have expected positions 1,2,3,2. The corresponding selected keys are 50,20,10,20.

A query of 35 therefore picks 50 in descending mode, whereas ascending mode picked 20. Both follow their own documented inequality. Reversing the data without also choosing the intended mode changes the problem.

Troubleshooting and limits

Use explicit 0 for ordinary unsorted IDs. Check that lookup and return ranges describe the same records, and inspect whether a result is a relative position rather than a worksheet coordinate.

The dedicated source does not establish a complete wildcard, case, duplicate-tie or mixed-type behavior matrix. Those details are held rather than copied from Excel. The fresh source search also surfaced community replies; they were not used as authoritative product evidence. Use VLOOKUP for a documented first-match value lookup or XMATCH when explicit search direction is required.

Product-specific verification

Related guides already published for this function: Microsoft Excel | LibreOffice Calc | Apache OpenOffice Calc | Gnumeric

A corresponding guide establishes separate documentation, not guaranteed identical defaults or file-conversion behavior. See the function comparison tool and editorial testing standards.

The full manuscript, original source table and all original formulas were reviewed on October 14, 2026. New outputs were independently modeled from explicit inputs. The previously approved availability/history section is retained exactly. No native Google Sheets execution or complete type/error matrix is claimed.