Skip to content
getgriddy.ai/blog/how-to-use-match-function-in-excel
Excel

How to Use MATCH in Excel

MATCH returns the position of a value inside a row or column. Use it when a lookup needs the row number, column number, or field position.

·5 min read

Reviewed by Griddy

Updated for current Excel and Google Sheets workflows, with examples chosen to map back to real spreadsheet tasks rather than abstract formula syntax.

MATCH returns the position of a value inside a single row or column. It does not return the value itself. It gives you the number another formula can use, usually INDEX.

Use MATCH when you need to find where a month, account, client, status, or header appears in a list.

The syntax

fx
=MATCH(lookup_value, lookup_array, [match_type])
  • lookup_value - the value you want to find
  • lookup_array - the one-row or one-column range to search
  • [match_type] - use 0 for exact match, 1 for approximate ascending match, or -1 for approximate descending match

For most operating sheets, exact match is the one you want.

fx
=MATCH("March", B1:M1, 0)

That returns the position of March inside the header row.

Example: find the month column in a budget

Suppose row 1 contains month headers from January through December, and column A contains budget categories.

You want a formula that can find the column position for the month selected in cell P1.

Step 1. Put the selected month in a control cell

Cell P1 contains:

April

Step 2. Match that month against the header row

fx
=MATCH(P1, B1:M1, 0)

If April is the fourth month in the range B1:M1, the formula returns 4.

Step 3. Use the position inside INDEX

If the Marketing budget row is B6:M6, this returns the Marketing value for the selected month:

fx
=INDEX(B6:M6, MATCH(P1, B1:M1, 0))

Now the selected month can change without rewriting the formula.

TIP

Use 0 as the match type when matching names, labels, months, statuses, or IDs.

MATCH vs XLOOKUP

XLOOKUP is usually easier when you want the result directly. MATCH earns its keep when the thing you need is a position:

  • which column contains the selected month
  • which row contains a client ID
  • where a field appears after an export changes column order
  • which item is first in a ranked list

It also pairs well with INDEX in workbooks that need to stay compatible with older Excel setups.

Common issues

IssueCauseFix
#N/AThe lookup value is not foundCheck spelling, spaces, and data type
Wrong positionApproximate match was used accidentallyUse 0 for exact match
#VALUE!The lookup array is two-dimensionalUse one row or one column only
Unexpected missOne value is text and the other is a numberNormalize the source values

The Griddy way

MATCH is simple until an export changes column order and half the workbook starts pointing at the wrong field.

"Find the column named April and use it to return the budget value for each category"

Griddy can build the MATCH or INDEX MATCH logic, apply it across the rows, and keep the formulas tied to the header labels instead of hard-coded positions.

Skip the manual work

Describe it. Griddy does it.

Instead of writing this formula yourself, just tell Griddy what you need in plain English. Works in Excel and Google Sheets.

Use this on real templates

Use MATCH when reports need flexible positions

MATCH is most useful in budget and billing sheets where month headers, account names, or exported field positions can move.

Finance