INDEX MATCH MATCH (two-way lookup), explained
Free, no login, no limit. Runs in your browser. Paste an Excel or Google Sheets formula and get it in plain English, step by step. Nothing you paste is sent anywhere.
In plain English
Returns the value in row the position of I1 in A2:A9, column the position of I2 in C1:E1 of C2:E9.
Works in: all current Excel versions, Google Sheets
Where each function is taught
Explain this Excel formula, step by step
Inside out: the order the spreadsheet works it out.
- 1MATCH
=MATCH(I1, A2:A9, 0)= 3Finds the position of
I1inA2:A9(1 = the first cell).0means exact match.key I1what to find range A2:A9one column or row to search 0 0exact match. Leave it out and MATCH assumes sorted data From the course:
Guide: INDEX MATCH, explained Lesson 16MATCHtells you where something is in a single column or row: 1 for the first cell, 2 for the second, and so on. - 2MATCH
=MATCH(I2, C1:E1, 0)= 1Finds the position of
I2inC1:E1(1 = the first cell).0means exact match.key I2what to find range C1:E1one column or row to search 0 0exact match. Leave it out and MATCH assumes sorted data From the course:
Guide: INDEX MATCH, explained Lesson 16MATCHtells you where something is in a single column or row: 1 for the first cell, 2 for the second, and so on. - 3INDEX
=INDEX(C2:E9, MATCH(I1, A2:A9, 0), MATCH(I2, C1:E1, 0))= 65Returns the value in row the result of step 1, column the result of step 2 of
C2:E9.range C2:E9the column (or row) to take a value from n the result of step 1 the position column the result of step 2 — From the course:
Guide: INDEX MATCH, explained Lesson 16INDEXdoes the opposite: give it a range and a position, and it returns the value at that position.
Try it on a sample sheet
We filled the cells your formula reads with sample numbers and put the formula in K1. Type your own values (text works too) and watch the result and the steps above update.
| A | B | C | D | E | F | G | H | I | J | K | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 44 | 61 | 78 | 31 | 65 | ||||||
| 2 | 47 | 81 | 98 | 25 | 44 | ||||||
| 3 | 84 | 28 | 45 | 62 | |||||||
| 4 | 31 | 65 | 82 | 99 | |||||||
| 5 | 68 | 12 | 29 | 46 | |||||||
| 6 | 15 | 49 | 66 | 83 | |||||||
| 7 | 52 | 86 | 13 | 30 | |||||||
| 8 | 89 | 33 | 50 | 67 | |||||||
| 9 | 36 | 70 | 87 | 14 |
What this formula does
A two-way lookup picks one cell out of a grid by its row label and its column label, like one rep's sales in one month. The first MATCH finds the row of the name in I1 down column A; the second finds the column of the month in I2 across row 1. INDEX takes both numbers and returns the cell where that row and column cross.
When to use it
Use it for any table with labels on two sides: sales by rep and month, prices by product and size, rates by band and year. It works in every Excel version and in Google Sheets, and one formula can fill a whole report grid if you lock the label references with mixed references.
Common mistakes
- Mixing up the order: INDEX takes the row number first, then the column.
- A column MATCH whose range doesn't line up with the grid's columns.
Variations
- =XLOOKUP(I1,A2:A9,XLOOKUP(I2,C1:E1,C2:E9))The same with nested XLOOKUP in Excel 2021 or later and Google Sheets.
- =INDEX($C$2:$E$9,MATCH($H2,$A$2:$A$9,0),MATCH(I$1,$C$1:$E$1,0))Locked for filling a whole grid across and down.
Read next
Practise this in 5 minutes
Everything this formula uses is taught in Lesson 35: Two-way lookups (Unit 10, Advanced lookups), on a live sheet with instant feedback. Pro
Open “Two-way lookups”Need a quick reference? The formula cheat sheet is free to read and print.
How the formula explainer works
It reads your formula with the same engine that grades formulastreak's lessons, then describes each function in the order a spreadsheet calculates it: the innermost first. Every argument gets a name and a plain-English meaning, taken from the lesson that teaches that function.
Then it builds a small sample sheet around the cells your formula reads, so you can see what each step returns and change the numbers to test it. Nothing is uploaded: it all happens in this page.
Google Sheets formulas too
Most formulas are written the same way in Excel and Google Sheets, so the explainer reads both. Under each explanation it says which Excel versions and whether Google Sheets have every function the formula uses, from Microsoft's and Google's own function lists. Where the two differ, such as SORT's direction argument or functions Google Sheets doesn't have, the note says so.
Want to understand the errors instead? Try the Excel error decoder, or read the formula guides.
Popular formulas, explained
- IFERROR with VLOOKUP, explained
=IFERROR(VLOOKUP(F2,$A$2:$C$9,3,FALSE),"Not found") - INDEX MATCH, explained
=INDEX($C$2:$C$9,MATCH(F2,$A$2:$A$9,0)) - INDEX MATCH MATCH (two-way lookup), explained
=INDEX(C2:E9,MATCH(I1,A2:A9,0),MATCH(I2,C1:E1,0)) - SUMIFS between two dates, explained
=SUMIFS(D2:D20,A2:A20,">="&H1,A2:A20,"<="&H2) - IF with AND, explained
=IF(AND(B2>=100,C2="Yes"),"Bonus","No bonus") - XLOOKUP with a not-found message, explained
=XLOOKUP(G2,A2:A9,C2:C9,"Missing") - COUNTIF to flag duplicates, explained
=COUNTIF($A$2:$A$11,A2)>1 - Count unique values with SUMPRODUCT and COUNTIF, explained
=SUMPRODUCT(1/COUNTIF(A2:A11,A2:A11)) - Nested IF for grades, explained
=IF(B2>=90,"A",IF(B2>=80,"B",IF(B2>=70,"C","F"))) - SORT with FILTER, explained
=SORT(FILTER(A2:C20,C2:C20>1000),3,-1)
Questions
Which formulas can it explain?+
Any formula written for Excel or Google Sheets: it reads cell references, ranges, operators, text, nested functions, LET and LAMBDA. It describes about 150 functions in detail. If it meets a function it doesn't know yet, it says so and still explains the rest.
Does my formula leave my computer?+
No. The explanation and the sample sheet run entirely in your browser. Nothing you paste is sent to our server.
Why does it explain the formula inside-out?+
That's the order a spreadsheet works it out: the innermost functions first, then the functions that use their results. Reading it in that order makes long formulas much easier to follow.
Does it work for formulas from another sheet or workbook?+
Yes. References like Prices!A2:C9 are explained without the sheet name. Excel table references like Table1[Amount] aren't supported yet.
Is it the same in Excel and Google Sheets?+
Most formulas are. Below each explanation you'll see which versions of Excel and whether Google Sheets support every function it uses.