Hands-On Excel

Hands-On Excel Challenges INDEX + MATCH

INDEX MATCH practice

=INDEX(A2:A8, MATCH(E2, C2:C8, 0)): MATCH finds where E2 sits in C2:C8, and INDEX returns the cell at the same position in A2:A8. It looks in any direction and works in every version of Excel.

AdvancedAbout 3 minutesFree, no sign-upBy Updated

Try it yourself

13 · INDEX + MATCH · Advanced

INDEX and MATCH together

The airport codes are in column C, but the city you need is in column A, to the left. In F2, find the city for the code in E2. Change E2 to test it.

MATCH(E2, C2:C8, 0) finds which row the code is on. INDEX(A2:A8, that row) returns the city from the same row. Both ranges must start on the same row.

airports.xlsx
Ready

Write in the green cells, then press Check. Click a cell while typing to insert it, drag to select a range, F4 adds $, Esc cancels.

The guide · INDEX + MATCH

MATCH finds the position

=MATCH("NBO", C2:C8, 0) returns 4, because NBO is the 4th cell of C2:C8. It's a position inside the range, not a row number on the sheet. The 0 asks for an exact match.

INDEX returns what's at a position

=INDEX(A2:A8, 4) returns the 4th cell of A2:A8, which is Nairobi.

Together

Put MATCH inside INDEX and the position flows from one to the other: =INDEX(A2:A8, MATCH(E2, C2:C8, 0)). Because the two ranges are separate, the column you return can be to the left of the one you search, which VLOOKUP can't do.

Both ranges must start on the same row

MATCH counts from the top of its range and INDEX counts from the top of its own. If MATCH uses C2:C8 and INDEX uses A1:A7, position 4 means row 5 for one and row 4 for the other, and every answer is the city from the row above. There's no error, so check one result by hand.

Don't forget the 0

Without the third argument, MATCH assumes the list is sorted and looks for the closest smaller value. On an unsorted list of codes that can return a wrong position without an error. Always write 0 for exact lookups.

INDEX MATCH, VLOOKUP or XLOOKUP?

XLOOKUP does the same job in one function in Excel 365 and 2021 or later. INDEX MATCH works everywhere, including older files and interview tests that ask for it by name. VLOOKUP is fine when the answer is to the right of the lookup column.

Common mistakes

FAQ

Why use INDEX MATCH instead of VLOOKUP?
INDEX MATCH can return a column to the left of the one you search, doesn't break when columns are inserted, and works in every version of Excel.
What does the 0 in MATCH mean?
It asks for an exact match. Without it, MATCH assumes the list is sorted in ascending order and can return the wrong position.
Why does my INDEX MATCH return the value from the wrong row?
The INDEX range and the MATCH range start on different rows. Make both start on the same row, for example A2:A8 and C2:C8.
Is INDEX MATCH better than XLOOKUP?
XLOOKUP is simpler if everyone using the file has Excel 365 or 2021 or later. INDEX MATCH is the safer choice for files shared with older versions.

All challenges

  1. 01 Add it upSUM Starter · 3 min
  2. 02 Find the averageAVERAGE Starter · 3 min
  3. 03 Write once, fill downRelative references Starter · 3 min
  4. 04 Lock it with $Absolute references Core · 3 min
  5. 05 Percent of a totalPercentages Starter · 3 min
  6. 06 Select to the end in one moveCtrl + Shift + arrow Core · 3 min
  7. 07 Pass or fail?IF Core · 3 min
  8. 08 Count the ones that matchCOUNTIF Core · 3 min
  9. 09 Add up with two conditionsSUMIFS Core · 3 min
  10. 10 Look it upVLOOKUP Core · 3 min
  11. 11 Find the right bracketVLOOKUP approximate match Core · 3 min
  12. 12 XLOOKUP, the modern wayXLOOKUP Core · 3 min
  13. 13 INDEX and MATCH togetherINDEX + MATCH Advanced · 3 min
  14. 14 Catch the error, not the bugIFERROR Core · 3 min
  15. 15 Split first and last namesLEFT, MID + FIND Core · 3 min
  16. 16 Mistake hunt: #N/A everywhereFixing #N/A Core · 3 min

Pro · coming soon

From first formula to job-ready.

100+ challenges on lookups, pivot tables, dates and text cleanup, an interview track modeled on the Excel tests employers use, and your progress saved across devices.

$29 one-time · early-bird price

You won't be charged today.

You're early!

Pro isn't open yet. We're building it right now. Leave your email and we'll hold the $29 early-bird price for you and tell you the day it launches.

We'll email you a link to confirm, then one email when Pro launches. Privacy