Example 1
Read one cell by position
C8 =INDEX(A2:C5,A8,B8)
Result: 1310
The range A2:C5 has four rows and three columns. Row 3, column 2 is B4.
C8 =INDEX(A2:C5,A8,B8) returns 1310
Returns the value at a given row and column of a range. Paired with MATCH, it is the classic lookup that works in every version of Excel.
Syntax
=INDEX(, , , )
Every version of Excel, including Microsoft 365, Excel 2024, 2021, 2019, 2016 and earlier, Excel for the web and the mobile apps.
Try it
Edit the formula in C8 or change the inputs. The sheet recalculates as you type.
C8 =INDEX(A2:C5,A8,B8) returns 1310
INDEX returns the value at a given position of a range: the third row, the second column. On its own that sounds trivial. Its real use is as the second half of a lookup, where MATCH works out the position and INDEX fetches the value.
INDEX(B1:H1,,3).Positions count inside the range, not on the sheet. INDEX(C5:C20,1) returns C5.
A row_num or column_num of 0 returns the whole column or row. In current Excel that result spills into the neighbouring cells, and it works inside functions such as SUM: =SUM(INDEX(B2:E9,0,3)) totals the third column.
=INDEX(C2:C9, MATCH(A12, A2:A9, 0)) finds A12 in A2:A9, then returns the item in the same position of C2:C9. Compared with VLOOKUP, this pairing:
The costs are length, and the fact that you must repeat the range sizes correctly: the INDEX range and the MATCH range must start on the same row. XLOOKUP does the same job in a single function and is easier to read, but it needs Excel 2021 or Microsoft 365. When a file must open in Excel 2019 or earlier, INDEX/MATCH is the safest choice.
For a two-way lookup, use two MATCH functions: =INDEX(B2:E9, MATCH(A12,A2:A9,0), MATCH(B12,B1:E1,0)).
INDEX doesn't just return a value. When it can, it returns a reference to the cell, which is why it can sit on either side of a colon: =SUM(B2:INDEX(B2:B20, 5)) adds B2 to B6. This is how you build a range that grows with the data without using the volatile OFFSET. INDEX isn't volatile, so it doesn't slow the workbook.
A row_num or column_num beyond the range returns #REF!. If MATCH inside INDEX returns #N/A, the whole formula returns #N/A. Wrap it in IFNA for a message.
B2:D9. It can also be several ranges in brackets, such as (A1:B5,D1:E5), for the reference form.0 returns the whole column. A number outside the range returns #REF!. For a one-column range you can use this argument alone.0 returns the whole row. For a one-row range you can leave row_num out and give only this one, as INDEX(B1:H1,,3).1. Rarely needed.Each example is a live sheet. Change the inputs or the formula and watch the result.
Example 1
C8 =INDEX(A2:C5,A8,B8)
Result: 1310
The range A2:C5 has four rows and three columns. Row 3, column 2 is B4.
C8 =INDEX(A2:C5,A8,B8) returns 1310
Example 2
B8 =INDEX(A2:A5,MATCH(A8,B2:B5,0))
Result: INV-2043
MATCH finds Northgate Print in B2:B5 and returns 3. INDEX then returns the third item of A2:A5. The answer is to the left of the search column, which VLOOKUP can't do.
B8 =INDEX(A2:A5,MATCH(A8,B2:B5,0)) returns INV-2043
Example 3
C7 =INDEX(B2:E4,MATCH(A7,A2:A4,0),MATCH(B7,B1:E1,0))
Result: 40,800
The first MATCH finds Finance in the row labels and returns 3. The second finds Q2 in the headers and returns 2. INDEX returns row 3, column 2 of B2:E4.
C7 =INDEX(B2:E4,MATCH(A7,A2:A4,0),MATCH(B7,B1:E1,0)) returns 40,800
Example 4
B7 =SUM(INDEX(B2:D4,0,A7))
Result: 233
A column_num of 0 means every row, so INDEX hands the whole third column, D2:D4, to SUM. Change A7 to total another month.
B7 =SUM(INDEX(B2:D4,0,A7)) returns 233
Solve it in the sheet. Every answer is checked, with hints if you need them.
Task 1 of 3
In B9, return the customer for the order in A9, using INDEX and MATCH.
Answer in B9.
INDEX(C2:C9, MATCH(A12, A3:A10, 0)) is off by one and returns the neighbouring item, with no error.0 in MATCH runs an approximate match, which needs sorted data and can return a wrong row silently. Always type 0 for an exact lookup.#REF! means the row or column number is larger than the range. #N/A from the MATCH means the lookup value wasn't found.It returns the value at a given row and column inside a range. Most often it is paired with MATCH, which supplies the row number, to do lookups.
It is more flexible. It can look left, doesn't count columns, and keeps working when columns are inserted. It is longer to write, though, and VLOOKUP is easier for most people to read. Both work in every version of Excel.
Only for compatibility. XLOOKUP does the same job in one function, matches exactly by default and has a not-found argument. Use INDEX/MATCH when the file must open in Excel 2019 or earlier.
No. INDEX recalculates only when its inputs change, unlike OFFSET and INDIRECT. That makes it the better choice for ranges that grow with the data.
Set the other position to 0. `=INDEX(B2:E9,3,0)` returns the third row of the range, and `=INDEX(B2:E9,0,2)` returns the second column. In current Excel the result spills.
INDEX is taught in Logic and text, lesson 14: TEXTSPLIT. Each lesson is a short, graded exercise like the one above.