
VLOOKUP needs the lookup value in the first column of the table and refers to the result column by number, so inserting a column quietly breaks it. Used together, INDEX and MATCH remove these limits, and they work in older versions of Excel too.
The two functions on their own
MATCH finds the position of a value in a list:
=MATCH("P-104",A2:A100,0)The 0 in the last argument means exact match. Use it almost every time.
INDEX returns the value at a given position in a range:
=INDEX(C2:C100,5)This returns the 5th value in C2:C100.
Putting them together
With product codes in column A, prices in column C and the code to find in F2:
=INDEX(C2:C100,MATCH(F2,A2:A100,0))MATCH finds the row number and INDEX returns the price on that row. Because the result column is selected directly, inserting columns does not break the formula.
Looking up to the left
If product names are in column D, codes in column A, and you want the code for a name:
=INDEX(A2:A100,MATCH(G2,D2:D100,0))VLOOKUP cannot do this. With INDEX and MATCH, column order does not matter.
Two-way lookup (row and column)
In a monthly sales table, regions are in A3:A10 and months in B2:M2. With the region in J1 and the month in J2:
=INDEX(B3:M10,MATCH(J1,A3:A10,0),MATCH(J2,B2:M2,0))The first MATCH finds the row, the second the column. The value at the intersection is returned.
Lookup with multiple criteria
Region (B) and product (C) must both match, and the result comes from column D:
=INDEX(D2:D100,MATCH(1,(B2:B100=G1)*(C2:C100=G2),0))The comparisons produce arrays of TRUE/FALSE values; multiplying them gives 1 only where both conditions are met. Outside Microsoft 365 you may need to confirm the formula with Ctrl + Shift + Enter.
Values that aren't found
If the code is not in the list, you get #N/A. To show a friendly message:
=IFERROR(INDEX(C2:C100,MATCH(F2,A2:A100,0)),"Not found")VLOOKUP vs INDEX-MATCH vs XLOOKUP
| Feature | VLOOKUP | INDEX + MATCH | XLOOKUP |
|---|---|---|---|
| Look to the left | No | Yes | Yes |
| Survives inserted columns | No | Yes | Yes |
| Two-way lookup | Awkward | Yes | By nesting |
| Works in older versions | Yes | Yes | No (2021+) |
In Microsoft 365, XLOOKUP is shorter to write. If the file will be shared with people on Excel 2016 or 2019, INDEX-MATCH is the safest choice. Newer versions also offer XMATCH, which adds options such as searching from the end.
Common mistakes
- Forgetting the 0: if the match type is left out, MATCH assumes a sorted list and may return the wrong row.
- Mismatched ranges: the INDEX and MATCH ranges must start on the same row and have the same length.
- Numbers vs text: the text "104" does not match the number 104. Keep code columns consistently formatted.
Step-by-step example: looking up to the left and matching on two conditions
Data: A: Order no., B: Customer, C: Product, D: Amount. Finding the amount from the order no. is easy; but finding the amount by the "Customer + Product" combination, or looking left from column D to pull the Customer, can't be done with VLOOKUP.
| Need | Formula |
|---|---|
| Find the customer from the amount (a leftward look) | =INDEX(B2:B500,MATCH(E2,D2:D500,0)) |
| Find the amount from the order no. | =INDEX(D2:D500,MATCH(E2,A2:A500,0)) |
| Find the amount by Customer + Product (Microsoft 365) | =INDEX(D2:D500,MATCH(1,(B2:B500=F2)*(C2:C500=G2),0)) |
| A message if not found | =IFERROR(INDEX(...),"No record") |
| Two-way: by row and column heading | =INDEX(B2:E10,MATCH(G1,A2:A10,0),MATCH(G2,B1:E1,0)) |
In older versions an array-style formula may need to be entered with Ctrl + Shift + Enter; in Microsoft 365 it works directly. For a simpler alternative see our XLOOKUP guide.
MATCH's match types
| Third argument | Meaning | When |
|---|---|---|
| 0 | Exact match | Recommended almost always |
| 1 | Less than or equal (ascending sorted list) | Range/band lookups |
| -1 | Greater than or equal (descending sorted list) | Rare |
When INDEX-MATCH instead of VLOOKUP?
- When you take a value from a column on the left.
- When the table structure changes often and columns are added and removed (it uses ranges, not column numbers).
- When performance matters on large tables.
- When a two-way or multi-condition lookup is needed.
For simple jobs VLOOKUP, or XLOOKUP in new versions, is enough (see our VLOOKUP and XLOOKUP guides).
Frequently asked questions
I get #N/A, why? The value isn't found: spelling, spaces (TRIM), text/number difference; or 1 may have been used instead of 0 in MATCH (see our data cleaning guide).
What does INDEX do alone? It returns the value at a given row/column of the range; MATCH finds the position of that row.
Can it return several results? No; only the first match. Use FILTER for all.
From another sheet or table? Range references are given with the sheet name or table name (Sales[Amount]; see our Excel tables guide).
Slowness? Use the real data range instead of a full-column reference.
Serkan Akyürek is the founder and author of toolrota; he writes step-by-step guides on Excel, AI, the cloud, personal finance and digital security.