Function · Lookup

Excel INDEX function

The Excel INDEX function returns the cell at a row and column you choose. A grocery price list, plus what a row number of 0 does.

All current Excel versions. Also in Excel for the web and Google Sheets.

Syntax =INDEX(array, row_num, [column_num])

INDEX
=INDEX(B2:B5,3)

Arguments

NameRequiredWhat to pass
arrayRequiredThe range that holds the value you want.
row_numRequiredThe row inside that range, starting at 1. A 0 returns the whole column, as an array, in current Excel.
column_numOptionalThe column inside the range, starting at 1. Omit it when the range is a single column.

Examples

The third price in a short grocery list

=INDEX(B2:B5,3)

Result $4.79

=INDEX(B2:B5,D2)D3
Prices
ABCD
1ItemPriceRow
2Whole milk3.493
3Eggs4.294.79
4Oat milk4.79
5Bread3.19
A picture of the sheet. D2 holds 3, and row 3 of B2:B5 is oat milk at $4.79.

INDEX does not search. You tell it the row, and it returns that cell. That sounds weaker than VLOOKUP until the row number comes from MATCH. The pair looks up a value in any column and returns a cell from any other column, to the left or the right.

In the price list, row 3 of B2:B5 is oat milk at $4.79. =MATCH("Oat milk",A2:A5,0) is the 3 you would otherwise type. Nest them when the list grows: =INDEX(B2:B5,MATCH("Oat milk",A2:A5,0)).

A row number of 0 is not “the header.” In current Excel it returns the whole column as an array. Older Excel returns #VALUE!. If you see a spill where you expected one price, the row argument is 0.