The INDEX function
INDEX picks one cell out of a range by its position: "row 2, column 2 of this grid". On its own that suits fixed tables like price grids.
Its real power comes with MATCH, which works out the position for you. INDEX(…, MATCH(…)) is a lookup that can return from any column and survives columns being inserted.
=INDEX(array, row_num, [column_num])
Arguments
- array
- The range to pick from.
- row_num
- Which row of the range, counting from 1 at the top.
- column_numoptional
- Which column of the range, counting from 1 at the left. Not needed for a single column.
Try it
=INDEX(B2:C4,2,2) in E2. Row 2 of the price grid is Child and column 2 is Weekend, so INDEX returns £8.00.
E2
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Ticket | Weekday | Weekend | Price | ||
| 2 | Adult | £9.50 | £12.50 | £8.00 | ||
| 3 | Child | £6.00 | £8.00 | |||
| 4 | Senior | £7.00 | £9.50 | |||
| 5 | ||||||
| 6 |
Edit the formula in E2, or change the data, and press Enter.
More examples
| Formula | Result | What it does |
|---|---|---|
| =INDEX(B2:C4,3,1) | £7.00 | Row 3, column 1: a senior on a weekday. |
| =INDEX(A2:A4,1) | Adult | A single column only needs a row number. |
| =INDEX(B2:C4,MATCH("Senior",A2:A4,0),MATCH("Weekend",B1:C1,0)) | £9.50 | Two MATCHes find the row and column by name, so nothing is hard-coded. |
| =INDEX(B2:C4,4,1) | #REF! | The grid only has 3 rows. |
Tips
- Row and column numbers count from the top-left of the range you give, not from A1.
- Use INDEX/MATCH instead of VLOOKUP when the answer is to the left of the lookup column.
- Lock the ranges with
$before copying an INDEX/MATCH formula.
Common mistakes
- INDEX returns the value one row out.The range includes the header row, or MATCH's range starts on a different row from INDEX's. Start both on the same row.
- #REF! appears.The row or column number is bigger than the range. Check the range covers the whole table.
Practise INDEX with instant feedback
Type real formulas into a working spreadsheet and get told straight away whether they work.