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.

INDEX availability by Excel version
VersionHas it
Microsoft 365 (Windows and Mac)Yes
Excel for the webYes
Excel 2024Yes
Excel 2021Yes
Excel 2019Yes
Excel 2016Yes

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.

Products (A1:D7)
RowABCD
1SKUProductCategoryPrice
2P-101Desk lampOffice24.50
3P-102Monitor standOffice39.00
4P-103USB-C hubElectronics45.00
5P-104WebcamElectronics69.00
6P-105Desk chairFurniture189.00
7P-106FootrestFurniture32.00
  1. 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. 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. 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

INDEX errors, causes and fixes
ErrorWhy it happensFix
#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/AWhen 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.

your-file.xlsx

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.

your-file-updated.xlsxYour original stays unchanged
  • Written for your platform and version
  • Checked against your actual data
  • Newest functions looked up in official docs
Try it free Formula Generator

Free plan, no credit card.

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