MATCH Function in Excel: Syntax, Match Types, INDEX MATCH, and Real Examples
Master the MATCH command in Excel: all 3 match types, INDEX MATCH combos, wildcards, error fixes, and two-way lookups with real examples.

The MATCH command in Excel is one of those functions that quietly sits behind the most powerful lookup formulas on your spreadsheet. It doesn't pull values like VLOOKUP, and it doesn't grab cells like INDEX, but it tells you exactly where something lives inside a list or range. Once you understand that small superpower, you stop wrestling with rigid column lookups and start building flexible, dynamic formulas that survive any layout change.
You'll see the MATCH function used in everything from inventory checks to payroll lookups, and it pairs beautifully with INDEX to replace older lookup tools. This guide breaks down every match type, every argument, every common error, and the smart ways to combine MATCH with other functions so you can finally write the kind of formulas that don't break the second someone reorders the columns.
What the MATCH Function Actually Does
MATCH searches a single row or column for a value you specify and returns the relative position of that value within the range. The position is a plain integer. If your lookup value sits in the third cell of the range, MATCH returns 3. That's the entire job. No value retrieval, no copying, no formatting. Just a position number.
That sounds simple, almost too simple. But the magic shows up when you feed that position number to another function. INDEX takes a position and returns the cell content at that spot. SUM, OFFSET, INDIRECT, and CHOOSE can all consume positions too. Once you treat MATCH as a position generator, your formulas become assemblies of small, focused pieces. Each piece does one thing well, and the whole formula stays readable.
The syntax looks like this: =MATCH(lookup_value, lookup_array, [match_type]). The third argument is optional but never ignore it. It controls whether MATCH finds an exact value, the largest value below your target, or the smallest value above it. Choosing the right match type is where most users either save time or invent bugs.
The Three Match Types Explained
Excel gives you three match types: 1, 0, and -1. Each behaves differently, and each demands a specific kind of source data. Mix them up and you'll get wrong answers without a single error message, which is the worst kind of bug.
Match type 0 is the everyday workhorse. You tell MATCH to find the value exactly, and the lookup array can be in any order. If the value isn't there, you get #N/A. This is the type to use for IDs, names, SKUs, anything categorical. Always pass 0 unless you have a genuine reason to do otherwise.
Match type 1 is the default when you skip the argument, and it assumes the lookup array is sorted in ascending order. It returns the position of the largest value that is less than or equal to your lookup value. Useful for bracket-style lookups like tax tables, shipping tiers, or grade boundaries. The catch? If your data isn't sorted ascending, you'll get nonsense without warning. Match type -1 mirrors that but for descending sorted arrays.
MATCH Function at a Glance
Quick Rule for MATCH
Always pass 0 as the third argument unless your data is sorted and you genuinely need approximate matching. Skipping the argument defaults to type 1, which assumes ascending sort and silently returns wrong answers on unsorted data.
MATCH Function Syntax
The value you want to find. Can be a number, text, logical value, or a cell reference like C1. Wildcards (asterisk and question mark) are allowed only when match type is set to 0. Mixed text and number types cause silent failures, so use VALUE() or TEXT() to force a clean conversion.
The single row or column of cells to search. Must be one-dimensional — MATCH refuses 2D ranges. Anchor with absolute references ($A$2:$A$20) when copying formulas down or across so the range doesn't drift off your table.
Pass 0 for exact match (works on unsorted data, returns first hit). Pass 1 for largest value less than or equal to your lookup (needs ascending sort). Pass -1 for smallest value greater than or equal (needs descending sort). Always type the argument — never leave it off.
An integer representing the relative position within lookup_array, starting at 1. Returns #N/A when no match is found. Feed this number into INDEX, OFFSET, INDIRECT, or CHOOSE to retrieve the actual content from that position.

Writing Your First MATCH Formula
Let's walk through a real example. Imagine a column of product codes in cells A2 to A20, and you want to know where "SKU-1042" sits in that list. You'd write =MATCH("SKU-1042", A2:A20, 0). If SKU-1042 is the seventh entry, you get 7. If it isn't there at all, you get #N/A.
Now make it dynamic. Put the code you want to find in cell C1, and change the formula to =MATCH(C1, A2:A20, 0). Now whoever uses the sheet just types a code in C1 and instantly sees its position. That's the foundation of every interactive lookup tool you'll ever build.
If you want to search a row instead of a column, just hand MATCH a horizontal range. =MATCH("January", A1:L1, 0) tells you which column January lives in. This is how you build two-way lookup tables when paired with INDEX, and we'll get to that combo in a minute.
INDEX MATCH: The Killer Combo
The reason people learn MATCH at all is so they can stop using VLOOKUP. The classic INDEX/MATCH pattern looks like =INDEX(return_range, MATCH(lookup_value, lookup_range, 0)). MATCH figures out the row position, and INDEX grabs the value from that row in whatever column you want.
Why bother? Because VLOOKUP forces your lookup column to be the leftmost column, and it can only look rightward. INDEX/MATCH doesn't care where the lookup column sits. You can look up an order number in column E and return the customer name from column B. Try that with VLOOKUP and you'll be rebuilding your table or writing a helper column.
Need a deeper dive? The Excel INDEX MATCH guide walks through every variation including multi-criteria lookups, approximate matches, and the new dynamic array versions.
Two-Way Lookups With Double MATCH
Once you understand how MATCH returns positions, you can do something neat: nest two MATCH calls inside one INDEX. The outer INDEX takes a 2D range, and you give it a row position and a column position. Each position comes from its own MATCH.
Picture a table of monthly sales by salesperson. Rows are salespeople, columns are months. You want this month's number for Priya. The formula is =INDEX(B2:M50, MATCH("Priya", A2:A50, 0), MATCH("November", B1:M1, 0)). The first MATCH finds Priya's row. The second finds November's column. INDEX returns the intersection.
Match Types in Action
=MATCH(C1, A2:A20, 0) returns the position of the first cell exactly matching C1. Use this 90% of the time. Returns #N/A if nothing matches. Works with text, numbers, and dates.
Match types 1 and -1 require sorted source data. If the sort breaks, MATCH still runs but returns garbage with no error message. Always pass 0 unless you're absolutely sure the array is sorted and stays sorted.
Match With Wildcards
MATCH supports wildcards when the match type is 0. The asterisk matches any number of characters, and the question mark matches exactly one. So =MATCH("Smith*", A2:A100, 0) finds the first cell starting with "Smith." It works for "Smithson," "Smithy," anything.
Wildcards only work with text lookups, not numbers. And if your real text actually contains an asterisk or question mark, you escape it with a tilde. =MATCH("Brand~?", A2:A100, 0) looks for the literal text "Brand?" instead of treating the question mark as a wildcard.
Wildcards combine beautifully with cell references. Try =MATCH("*"&C1&"*", A2:A100, 0) to find the first cell containing whatever text sits in C1. That's a partial-match lookup in one line, and it doesn't need helper columns or array entry.
Handling Errors The Right Way
The most common error is #N/A, which means MATCH couldn't find your value. Sometimes that's information. Other times you want a friendlier message. Wrap MATCH in IFERROR or IFNA: =IFERROR(MATCH(C1, A2:A20, 0), "Not Found"). Now non-matches show readable text instead of an error code.
Other errors you'll meet: #VALUE! usually means a text/number mismatch. You typed "5" as text but the column has real numbers, or vice versa. Cells formatted as text look identical to real numbers but MATCH treats them as different species. The #VALUE! error guide covers every cause and fix.
#REF! happens when your lookup array points to deleted cells. Always anchor your ranges with absolute references when you copy a formula down, or you'll watch your lookup range silently drift off the table.
MATCH vs Other Lookup Tools
Excel has many ways to find things. MATCH, FIND, SEARCH, VLOOKUP, HLOOKUP, XLOOKUP, INDEX/MATCH. They sound similar but do different jobs. Knowing which one to grab saves serious time.
FIND and SEARCH look inside a single string for a substring and return its character position. They're for parsing text, not searching ranges. MATCH searches a range of cells for an entire value. Confusing them is common but the distinction matters.
XLOOKUP, available in Microsoft 365 and Excel 2021 onward, basically rolls VLOOKUP and INDEX/MATCH into one function. The XLOOKUP guide compares it head-to-head with the older lookup family.

MATCH Formula Checklist
- ✓Set match_type to 0 unless you have a specific approximate-match reason
- ✓Anchor lookup_array with absolute references ($A$2:$A$100) when copying down
- ✓Wrap in IFERROR or IFNA for user-friendly error messages
- ✓TRIM text data to remove invisible whitespace before matching
- ✓Use VALUE() to force text-as-numbers to actual numbers
- ✓Test with one known value first, then expand to the full range
- ✓Pair with INDEX for value retrieval instead of VLOOKUP
- ✓Use wildcards (* and ?) for partial text matches with type 0
Performance and Big Datasets
MATCH is fast. Like, really fast. On modern Excel it crushes VLOOKUP on long arrays, especially with exact match. If your workbook is sluggish from thousands of VLOOKUPs, switching to INDEX/MATCH often shaves seconds off every recalculation cycle. The improvement comes from how Excel optimizes the calculation engine for INDEX and MATCH separately, then caches intermediate results.
The trick with type-1 and type-minus-1 matches is that they use binary search under the hood, assuming sorted data. That makes them incredibly fast on huge datasets — millions of rows feel instant. But you must keep the data sorted. If you can't guarantee sorting, stick with type 0 and accept linear search speed. Linear search isn't slow in any human sense, just slower than binary in raw benchmarks.
For really enormous data, consider Power Query or pivot tables instead of formula lookups. MATCH is built for direct cell references, not millions of rows. Once you're above a hundred thousand rows, the right answer is usually to reshape your data layer first, then run formulas against the smaller, cleaned result.
MATCH In Dynamic Arrays
The new dynamic array engine in Microsoft 365 changes how MATCH plays with other formulas. You can pass an array of lookup values and get back an array of positions in one shot. =MATCH(C1:C10, A1:A100, 0) entered in a cell spills ten results down, one per lookup. That used to require array entry with Ctrl+Shift+Enter and a lot of explanation.
Combined with INDEX, this lets you build lookup ranges without dragging formulas. =INDEX(B1:B100, MATCH(C1:C10, A1:A100, 0)) returns ten matching values, spilling down automatically. The whole table updates the moment you change any input.
MATCH Performance Numbers

Real World Use Cases
Where do people actually use MATCH? Inventory teams use it to flag SKUs that exist in one list but not another. HR teams pair MATCH with INDEX for employee lookups by ID, role, or department. Finance teams build flexible reporting tools where users pick a month from a drop-down and see the matching column populate. Auditors use MATCH to reconcile two ledgers row by row.
One pattern that earns its keep: comparing two lists. =ISNUMBER(MATCH(A2, OtherList!A:A, 0)) returns TRUE if A2 appears in the other list, FALSE otherwise. Drop that down a thousand rows and you've got a difference report in seconds. The compare columns guide shows several variants including conditional formatting and Power Query approaches.
Another pattern: a dashboard where the user types a customer ID in one cell and a dozen other cells pull customer details. Each detail cell is INDEX/MATCH against a separate column. Type a new ID, hit enter, the whole dashboard refreshes. No macros, no buttons, just formulas working in concert.
Common MATCH Mistakes
The biggest trap is forgetting the third argument. If you leave it out, you get type-1 behavior, which expects sorted data. People write =MATCH(C1, A:A), get a wrong answer, and assume their data is broken. The data is fine; the formula needs a 0 at the end. Make it a habit to always type the third argument explicitly, even when you know it's a default.
Another classic: mixing absolute and relative references when copying formulas. If you don't anchor the lookup range, the range shifts as you drag the formula, and suddenly your last row is matching against half a range. Always lock the array with dollar signs.
And a subtle one: leading or trailing spaces. "Smith" and "Smith " look identical but MATCH sees them as different. TRIM your data or use MATCH(TRIM(C1), A2:A100, 0) if you suspect whitespace issues. Better yet, clean the source data once with Find and Replace, then never worry again.
Putting It All Together
MATCH is small but mighty. By itself it just hands you a position. Combined with INDEX, OFFSET, INDIRECT, CHOOSE, or used inside conditional logic, it becomes the backbone of professional spreadsheet engineering. Once you stop thinking of lookups as "find this value" and start thinking of them as "find this position, then pick what you want," the whole formula world opens up.
The fastest way to internalize MATCH is to rebuild a few of your existing VLOOKUPs as INDEX/MATCH. You'll catch the syntax in twenty minutes and never look back. Bookmark the IF function guide for the conditional patterns you'll often pair with MATCH. Master MATCH, and you stop fighting your spreadsheets — you start designing them.
One last note on practice: the MATCH command rewards repetition more than reading. Open a blank workbook, dump in a few hundred rows of fake data, and try every match type, every wildcard pattern, and a handful of INDEX combinations. Break the formulas on purpose. Watch what errors show up. Fix them. After a couple of hours of hands-on play, you'll know MATCH better than 90% of the people who list "advanced Excel" on their resume.
Pro Tip — Build a Lookup Library Once: Keep a hidden worksheet with your most-used INDEX/MATCH patterns as named formulas. When you need a two-way lookup, a multi-criteria match, or a partial-text find, you copy the named formula instead of rewriting it. Five minutes of setup saves hours over a year of spreadsheet work.
MATCH With Multiple Criteria
Stock MATCH only takes one lookup value, but you can fake multi-criteria lookups with concatenation or array tricks. The simplest approach: build a helper column joining the criteria, then MATCH against the joined values. =A2&"|"&B2 in a helper, then =MATCH(C1&"|"&D1, HelperRange, 0) to find the combination. The pipe character is arbitrary — pick any delimiter your data doesn't contain.
For an inline approach without helpers, Microsoft 365 users can do =MATCH(1, (A2:A100=C1)*(B2:B100=D1), 0) with dynamic arrays handling it natively. Older versions need Ctrl+Shift+Enter to confirm as an array formula. The logic: multiply two TRUE/FALSE arrays so only rows matching both criteria produce a 1, then MATCH finds the first 1.
This pattern scales. Three criteria? Add another (C2:C100=E1) factor inside the parentheses. The product is still 1 only when every criterion matches. It's elegant, fast, and avoids helper columns when you need a cleaner sheet. This is one of the most common interview questions in Excel-heavy roles, so practice it before any data analyst test. The Excel lookup functions guide covers multi-criteria patterns alongside every other lookup tool.
MATCH vs VLOOKUP
- +Lookup column can be anywhere, not just leftmost
- +Faster on large datasets, especially with binary search
- +Pairs with INDEX for two-way and multi-criteria lookups
- +Returns positions, useful for OFFSET, INDIRECT, CHOOSE
- +Survives column reordering when used with INDEX
- +Native wildcard support with match type 0
- −Two-function setup (INDEX MATCH) is more typing than VLOOKUP
- −Steeper learning curve for first-time users
- −Default match type 1 silently fails on unsorted data
- −Returns position only, needs INDEX to grab the actual value
- −Multi-criteria needs array formula or helper column
- −Harder to debug when nested deep inside other formulas
Excel Questions and Answers
About the Author
Attorney & Bar Exam Preparation Specialist
Yale Law SchoolJames R. Hargrove is a practicing attorney and legal educator with a Juris Doctor from Yale Law School and an LLM in Constitutional Law. With over a decade of experience coaching bar exam candidates across multiple jurisdictions, he specializes in MBE strategy, state-specific essay preparation, and multistate performance test techniques.