MATCH

Short answer

Find the position of a value, and always write the 0

MATCH(lookup_value, lookup_array, [match_type])
Excel version
All versions
Also searched as
index match, lookup position, period column, find row number, match type, approximate match, tier lookup, match exact

What it returns

MATCH returns the position of a value in a single row or column, counted from 1. Look for April in a row of month headers that starts at January and you get 4.

The trap is the default. Leave out the third argument and MATCH does not look for an exact match. It runs an approximate match that assumes the list is sorted ascending and returns the last position whose value is less than or equal to what you asked for. On a sorted list of thresholds that is exactly right. On an unsorted list of account codes or names it returns a position that looks reasonable and is wrong, with no error.

MATCH almost always sits inside INDEX, which reads the cell at that position.

Arguments that matter

ArgumentRequiredWhat it does
lookup_valueYesWhat you are looking for. A selected month, an account code, a volume.
lookup_arrayYesOne row or one column to search.
match_typeNo0 exact. 1 (the default) largest value less than or equal, list sorted ascending. -1 smallest value greater than or equal, list sorted descending.

What each mode is for:

  • 0 is for keys: account codes, entity names, month headers. Returns the first exact match or #N/A. It accepts wildcards in text, so "Rev*" matches “Revenue”.
  • 1 is for thresholds sorted ascending: tax brackets, volume tiers, covenant step-downs. It returns the largest value at or below the lookup value. -1 does the same on a table sorted descending, returning the smallest value at or above it.
  • -1 is the same idea for a list sorted descending. Rare in models.

MATCH ignores case. “REVENUE” and “Revenue” are the same key.

In a financial model

Write the 0. In an inherited model, the first audit pass on lookups is a search for MATCH( followed by a scan for any call with two arguments, or with a 1 against a list that is not a threshold table.

The legitimate jobs:

  • The period pointer. The column for the selected month, fed to INDEX for a single value or to start:INDEX(...) for a year-to-date range.
  • The row pointer. The row for a line item or account in a block, for a two-way INDEX lookup.
  • Tier lookups. A rate card with volume floors in ascending order, where MATCH with 1 finds the tier a volume falls into.
  • A membership test. ISNUMBER(MATCH(x, list, 0)) returns TRUE when the item is in the list. In a mapping check, it flags codes that the map does not cover, per one mapping table per dimension.

Period pointers only work when the header row holds real dates, per date headers are real dates. In Excel 2021 and 365, XMATCH does every one of these jobs with a safer default.

Worked example

A forecast on tab Fcst with month-end dates across Fcst!$D$5:$O$5 (Jan-26 to Dec-26). The summary tab holds the selected month in $C$3, entered as 30-Apr-2026.

The column for the selected month:

=MATCH($C$3, Fcst!$D$5:$O$5, 0)

Returns 4. Fed to INDEX, it reads April for any line:

=INDEX(Fcst!$D$6:$O$6, MATCH($C$3, Fcst!$D$5:$O$5, 0))

A rebate tier table on tab Rates, floors sorted ascending:

Rates!B (volume floor)Rates!C (rebate)
05.0%
10,0004.0%
50,0003.0%
100,0002.0%

The rebate for a customer with 62,500 units in B5:

=INDEX(Rates!$C$5:$C$8, MATCH(B5, Rates!$B$5:$B$8, 1))

62,500 is past 50,000 and short of 100,000, so MATCH returns 3 and INDEX returns 3.0%. The 1 is written out even though it is the default, so a reviewer can see the approximate match is deliberate.

A count of ledger codes with no mapping, for the check row:

=SUMPRODUCT(--ISNA(MATCH(GL[Code], Map[Code], 0)))

It should read zero.

Old way vs new way

The MATCH version of the period pointer:

=MATCH($C$3, Fcst!$D$5:$O$5, 0)

The XMATCH version, Excel 2021 and later:

=XMATCH($C$3, Fcst!$D$5:$O$5)

Same result. XMATCH is exact when you leave the third argument out, so the trap disappears. Keep MATCH when the file has to open in Excel 2019 or earlier.

Where it breaks

A lookup returns a plausible wrong row. match_type is missing, so MATCH ran an approximate search on an unsorted list. Nothing errors. Fix: add the 0, then recheck every number that depended on it.

MATCH returns #N/A for a code that is visibly in the list. One side is a number and the other is text: 4100 typed in the input, "4100" in an export. Fix: convert the export column to numbers in Power Query or with VALUE, and keep the key type the same on both sides.

MATCH returns #N/A for a month that is in the header row. The headers are text reading “Apr-26”, or the selector holds a first-of-month date against month-end headers. Fix: one date convention for the whole model, enforced with data validation on the selector.

A tier lookup returns the tier above or below. The threshold table is not sorted ascending, or someone added a row at the bottom. Fix: sort the table, and add a check that each floor is larger than the one above it.

The first of two duplicates wins. MATCH with 0 returns the first match only. Two rows for the same account means the second is never read. Fix: test the key column for duplicates with COUNTIFS in the check row.

An asterisk in the data matches everything. Exact mode honours wildcards, so a lookup value like "A*" matches the first item starting with A. Fix: escape literal wildcards with a tilde, "A~*", or use XMATCH, whose exact mode treats them as plain characters.

Related functions

  • INDEX. Reads the cell at the position MATCH returns. The pair is the lookup that works in every version of Excel.
  • XMATCH. The modern MATCH: exact by default, searches last to first, and its match_mode signs run the opposite way to MATCH’s match_type.
  • XLOOKUP. Returns the value instead of the position when you do not need a pointer.
  • COUNTIFS. Finds duplicate keys before MATCH silently picks the first one.
  • HAS. A plain membership test, once it leaves Insiders preview.
  • The play one mapping table per dimension is where a MATCH-based check for unmapped codes belongs.

All functions