Cellwise Try it free

Lookup function

Excel INDEX function

INDEX returns the value at a given row and column position inside a range. On its own it is like saying "give me row 3, column 2". Combined with MATCH, it becomes a lookup that works in any direction.

=INDEX(array, row_num, [column_num])

Arguments

array
The range to pick from.
row_num
Which row of the range to return, counting from 1.
column_num
Which column to return. Optional for a single row or column.

INDEX examples

Every result below was calculated from this sample sheet by the same spreadsheet engine the Cellwise app uses.

ABCD
1SizeSmallMediumLarge
2Latte3.754.254.75
3Mocha4.14.65.1
4Cold brew3.544.5
5Chai3.64.14.6
  1. =INDEX(A2:A5,3)

    Result: Cold brew

    Returns the 3rd item in the drink list: "Cold brew".

  2. =INDEX(B2:D5,2,3)

    Result: 5.1

    Row 2, column 3 of the price grid: a Large Mocha costs 5.1.

  3. =INDEX(B2:D5,MATCH("Chai",A2:A5,0),MATCH("Medium",B1:D1,0))

    Result: 4.1

    Two MATCHes find the row and column, so INDEX returns a Medium Chai: 4.1.

  4. =INDEX(B2:D5,5,1)

    Result: #REF!

    There is no 5th row in the range, so INDEX returns #REF!.

How to use INDEX

  1. Type =INDEX( and select the range to pick from.
  2. Add the row number.
  3. For a grid, add the column number too.
  4. Replace hard-coded numbers with MATCH to make it a lookup.

Common INDEX mistakes

Row number counts from the sheet

row_num counts from the top of the range, not row 1 of the sheet. In B2:D5, row 1 is sheet row 2.

Position outside the range

A row or column number bigger than the range gives #REF!. Check the size of your range.

Ranges that do not line up

With INDEX/MATCH, the MATCH range must start on the same row as the INDEX range or results are shifted.

INDEX FAQ

Why use INDEX MATCH instead of VLOOKUP?

INDEX/MATCH can return from any column, including ones to the left, and does not break when you insert columns.

How do I do a two-way lookup in Excel?

Use INDEX with two MATCHes: =INDEX(B2:D5,MATCH(row_item,A2:A5,0),MATCH(col_item,B1:D1,0)).

Can INDEX return a whole row or column?

Yes. Use 0 for the other argument: =INDEX(B2:D5,0,2) returns the entire second column, which you can wrap in SUM.

Practice INDEX in these lessons

Guides that use INDEX

Related functions

Updated