Excel functions · Lookup
INDEX function in Excel
INDEX returns the value at a given row and column position inside a range, such as the 4th row and 2nd column of a table. On its own it's a way to pick a cell by position; combined with MATCH, which finds that position, it becomes a lookup that works in every Excel version.
Last reviewed
Syntax
=INDEX(array, row_num, [column_num])=INDEX(reference, row_num, [column_num], [area_num])- array / referencerequired
- The range to pick from.
- row_numrequired
- The row position inside the range, counted from 1. Use 0 to return the whole column.
- column_numoptional
- The column position inside the range. Can be left out when the range is a single column.
- area_numoptional
- In the reference form, which of several ranges to use, such as (A1:B4, D1:E4). Rarely needed.
- Positions count from the start of the range, not the sheet: row 1 of A2:D7 is sheet row 2.
- INDEX with MATCH can return a column left of the lookup column and doesn't break when columns are inserted.
Which versions have INDEX
Every current Excel version: Microsoft 365, Excel for the web, Excel 2024, 2021, 2019 and 2016, on Windows and Mac.
| Version | Has it |
|---|---|
| Microsoft 365 (Windows and Mac) | Yes |
| Excel for the web | Yes |
| Excel 2024 | Yes |
| Excel 2021 | Yes |
| Excel 2019 | Yes |
| Excel 2016 | Yes |
Google Sheets
Google Sheets has INDEX(reference, [row], [column]) and the INDEX with MATCH pattern works the same way.
Examples
The examples use this sample sheet.
| Row | A | B | C | D |
|---|---|---|---|---|
| 1 | SKU | Product | Category | Price |
| 2 | P-101 | Desk lamp | Office | 24.50 |
| 3 | P-102 | Monitor stand | Office | 39.00 |
| 4 | P-103 | USB-C hub | Electronics | 45.00 |
| 5 | P-104 | Webcam | Electronics | 69.00 |
| 6 | P-105 | Desk chair | Furniture | 189.00 |
| 7 | P-106 | Footrest | Furniture | 32.00 |
1.Pick a cell by position
=INDEX(A2:D7, 4, 2)Result: Webcam
Row 4 of A2:D7 is P-104, and column 2 is Product.
2.Pick from a single column
=INDEX(D2:D7, 5)Result: 189.00
The 5th price in the list belongs to the Desk chair.
3.INDEX with MATCH as a lookup
=INDEX(B2:B7, MATCH("P-103", A2:A7, 0))Result: USB-C hub
MATCH finds P-103 at position 3, and INDEX returns the 3rd product name.
Common errors and fixes
| Error | Why it happens | Fix |
|---|---|---|
| #REF! | row_num or column_num points outside the range, such as row 9 of a 6-row range. | Check the size of the range and the position you pass in. |
| #VALUE! | row_num or column_num isn't a number, often text from another cell. | Pass a number, or convert it with VALUE. |
| #N/A | When used with MATCH, MATCH found nothing. | Fix the MATCH part (exact match needs 0 as its third argument), or wrap the whole formula in IFERROR. |
Do it with GPTExcel
Skip writing INDEX by hand
Upload your Excel or CSV file to Chat and ask in plain English. GPTExcel writes the formula for your file and your version of Excel or Google Sheets.
Write an INDEX MATCH formula that finds each order's price, and explain it.
Done. I used INDEX on your sheet and checked the results against your data.
- Written for your platform and version
- Checked against your actual data
- Newest functions looked up in official docs
INDEX questions
- Why use INDEX and MATCH instead of VLOOKUP?
- INDEX with MATCH can return a column on either side of the lookup column, and it doesn't break when you insert or delete columns, because it doesn't use a fixed column number. It works in every Excel version.
- Is INDEX MATCH still needed now that XLOOKUP exists?
- Only for files that must open in Excel 2019 or older. In Microsoft 365 and Excel 2021 or later, XLOOKUP does the same job in one function.
Skip the formula hunt
Upload a spreadsheet and ask in plain English. Free plan, no credit card.
Start free