Lookup & reference function

INDEX function

Returns the value at a given row and column position inside a range, or a whole row or column of it.

Available in All versions of Excel, including Microsoft 365, Excel for the web and Excel for Mac

In every Excel versionWorks in Google Sheets

Syntax

INDEX(array, row_num, [column_num], [area_num])
ArgumentWhat it means
arrayRequiredThe range or array to pick from. It can also be several ranges in brackets, e.g. (A2:C5, E2:G5).
row_numRequiredThe row position inside array (1 = first row). Use 0 to return the entire column.
column_numOptionalThe column position inside array. Use 0 to return the entire row. Can be left out for a single-column range.
area_numOptionalWhen array lists several ranges, which one to use (1 = first). Default 1.

Returns: The value (actually a reference) at the intersection of row_num and column_num, or a whole row/column when one of them is 0.

How INDEX works

INDEX answers the question "what is in row x, column y of this table?". On its own it is simple: =INDEX(B2:B5, 3) gives you the third item of the list. Its real power appears when another function supplies the position - most famously MATCH, which finds where a value sits. INDEX + MATCH was the go-to flexible lookup for decades because, unlike VLOOKUP, it can return from any column, including ones to the left.

Positions are always counted from the top-left of the range you give, not from row 1 of the sheet. If you set row_num to 0 INDEX returns the whole column, and if you set column_num to 0 it returns the whole row; in Microsoft 365 those results spill. Because INDEX returns a reference rather than just a value, it can also form one end of a range, as in SUM(B2:INDEX(B2:B13, 6)), which sums January to June.

INDEX is non-volatile, so it is a faster and safer choice than OFFSET or INDIRECT for building dynamic ranges.

Examples

1Pick the 3rd item from a list

E2fx=INDEX(B2:B5, 3)
ABCDE
1CodeProductPrice
2P-101Keyboard25Monitor
3P-102Mouse12
4P-103Monitor149
5P-104Webcam39

Result: Monitor

Position 3 of B2:B5 is cell B4.

2Row and column in a grid

B6fx=INDEX(B2:E4, 2, 3)
ABCDE
1RegionQ1Q2Q3Q4
2North12500142001390016100
3South9800104001125012030
4East7600815089009420
5
611250

Result: 11250

Inside B2:E4, row 2 is South and column 3 is Q3, so INDEX returns cell D3.

3INDEX + MATCH lookup

E2fx=INDEX(C2:C5, MATCH("Webcam", B2:B5, 0))
ABCDE
1CodeProductPrice
2P-101Keyboard2539
3P-102Mouse12
4P-103Monitor149
5P-104Webcam39

Result: 39

MATCH finds Webcam at position 4 of B2:B5, and INDEX returns position 4 of C2:C5. Insert columns between B and C and the formula still works.

4Return a whole row

E2fx=INDEX(A2:C5, 2, 0)
ABCDEFG
1CodeProductPrice
2P-101Keyboard25P-102Mouse12
3P-102Mouse12
4P-103Monitor149
5P-104Webcam39

A column number of 0 asks for every column of row 2, so the record for the mouse spills into E2:G2.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 18 KB

Common errors and how to fix them

ErrorWhy it happensFix
#REF!row_num or column_num points outside the range, e.g. row 6 of a 4-row range.Check the positions, or wrap the formula in IFERROR.
#N/AThe nested MATCH did not find its value.Fix the lookup value or use MATCH with 0 for an exact match.
#VALUE!A position is text or a negative number.Make sure positions are whole numbers of 1 or more (or 0 for an entire row/column).

Tips

  • Count positions from the start of the range, not from the sheet: INDEX(B5:B9, 1) returns B5.
  • Two-way lookup: =INDEX(B2:E4, MATCH("South", A2:A4, 0), MATCH("Q3", B1:E1, 0)).
  • =SUM(B2:INDEX(B2:B13, E1)) builds a year-to-date total for the number of months typed in E1 without volatile functions.

Questions

Is INDEX MATCH still worth learning?

Yes. It works in every Excel version, handles left lookups and two-way lookups, and appears in countless existing workbooks.

What does INDEX return with a row number of 0?

The whole column of the range (and a column number of 0 returns the whole row). In Microsoft 365 the result spills into neighbouring cells.

Google Sheets

INDEX also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

INDEX in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
DanishINDEKS
FinnishINDEKSI
ItalianINDICE
Norwegian (Bokmål)INDEKS
PolishINDEKS
Portuguese (Brazil)ÍNDICE
Portuguese (Portugal)ÍNDICE
RussianИНДЕКС
SpanishINDICE
TurkishİNDİS

Recipes that use INDEX