INDEX

Short answer

Read the cell at a row and column, or build a range end

INDEX(array, row_num, [column_num])
Excel version
All versions
Also searched as
index match, two-way lookup, position lookup, dynamic range, non-volatile offset, return whole column, index reference, ytd range

What it returns

INDEX returns the cell at a given row and column of a range. =INDEX(D6:O40, 3, 4) returns the value three rows down and four columns across, which is G8.

The part most people miss is that INDEX returns a reference, not just a value. Put it on either side of a colon and it marks the end of a range: =SUM(D6:INDEX(D6:O6, 4)) sums D6:G6. That is how you build a range whose size changes with an input, and it is the non-volatile replacement for OFFSET.

On its own INDEX rarely finds anything. It reads a position that something else worked out, usually MATCH or XMATCH.

Arguments that matter

ArgumentRequiredWhat it does
arrayYesThe range to read from. A block of numbers, one row, or one column.
row_numYesWhich row, counted from 1. 0 returns every row of the chosen column.
column_numNoWhich column, counted from 1. 0 returns every column of the chosen row. Leave it out for a single column.

Two rules decide most of what goes wrong.

A one-row or one-column range takes one number. INDEX(D5:O5, 4) returns the fourth header across, even though the number sits in the row_num slot. Excel treats the single number as the position along whichever direction the range runs.

Zero is not an error. row_num of 0 returns the whole column, and column_num of 0 returns the whole row. In Excel 2021 and 365 that spills. If a calculated position comes out as 0, INDEX does not complain. It hands back the entire row or column, and a SUM wrapped around it reports a much larger number.

There is also a fourth argument, area_num, for a reference made of several separate ranges. It exists. Models that use it are hard to audit, so leave it alone.

In a financial model

INDEX does three jobs, and only the first is a lookup.

  • Two-way lookup. INDEX with a MATCH for the row and a MATCH for the column reads one cell out of a grid: a line item for a selected month, a rate for a tier and a year.
  • Range ends. start:INDEX(...) builds a year-to-date range, a range that stops at the last actual month, or a window that moves with a period selector. The result recalculates only when its inputs change.
  • Whole slices. INDEX(block, 0, n) pulls one month as a column for a summary tab. In Excel 365, CHOOSECOLS does the same with a clearer name.

All three depend on the position being right, which depends on the header row holding real values that compare cleanly. Month headers should be real dates, per date headers are real dates.

Worked example

A forecast block on tab Fcst. Month-end dates run across Fcst!$D$5:$O$5 (Jan-26 to Dec-26). Line item names run down Fcst!$B$6:$B$40. The summary tab has the selected month in $C$3, entered as 30-Apr-2026.

FcstD (Jan-26)E (Feb-26)F (Mar-26)G (Apr-26)
Row 6: Revenue812,400798,100845,600861,300

Revenue for the selected month, as a two-way lookup:

=INDEX(Fcst!$D$6:$O$40,
       MATCH("Revenue", Fcst!$B$6:$B$40, 0),
       MATCH($C$3, Fcst!$D$5:$O$5, 0))

The first MATCH returns 1 for the row, the second returns 4 for April, and INDEX returns 861,300.

Year to date for the same line, January through the selected month:

=SUM(Fcst!$D6:INDEX(Fcst!$D6:$O6, MATCH($C$3, Fcst!$D$5:$O$5, 0)))

INDEX returns the reference G6, the colon turns D6:G6 into a range, and SUM returns 3,317,400. Change $C$3 to July and the range runs to J6 with no edit to the formula.

The whole April column for every line, spilled down a summary tab in Excel 2021 or 365:

=INDEX(Fcst!$D$6:$O$40, 0, MATCH($C$3, Fcst!$D$5:$O$5, 0))

Old way vs new way

The OFFSET version of the year-to-date sum:

=SUM(OFFSET(Fcst!$D6, 0, 0, 1, MATCH($C$3, Fcst!$D$5:$O$5, 0)))

The INDEX version:

=SUM(Fcst!$D6:INDEX(Fcst!$D6:$O6, MATCH($C$3, Fcst!$D$5:$O$5, 0)))

Same answer. OFFSET is volatile, so it recalculates on every edit anywhere in the workbook, and Trace Precedents cannot show which cells it reads. INDEX recalculates only when the selector or the row changes, and the range it can reach is written in the formula. That is why avoid volatile functions names OFFSET and points to INDEX.

Where it breaks

A year-to-date SUM suddenly reports the full year. The position fed to INDEX came out as 0, for example from a calculation like MATCH(...)-1 in the first month. INDEX read 0 as “the whole row”. Fix: wrap the position in MAX(1, ...), or test for it in the check row.

INDEX returns #REF!. The position is larger than the range: row 13 of a 12-row block. Usually the selector moved to a month outside the forecast horizon. Fix: make the MATCH lookup range and the INDEX range cover the same periods.

The right row label, the wrong number. The MATCH range starts on a different row or column from the INDEX range, so every position is shifted by one. Fix: start both ranges on the same row or column, and check one value by hand.

A two-way lookup returns a plausible wrong value. One of the MATCH calls left out its third argument and ran an approximate match on unsorted labels. Fix: write the 0 in every MATCH, or use XMATCH, which is exact by default.

INDEX returns one value instead of a column. The file is open in Excel 2019 or earlier, which shows one cell of a 0 row or column through implicit intersection. Fix: in older versions, use the slice inside an aggregate such as SUM, or select the output range and confirm with Ctrl+Shift+Enter.

Inserted columns break the lookup. They do not, provided the ranges are anchored ranges rather than typed column numbers. A hard-coded column_num of 4 is the same trap as VLOOKUP’s column index. Fix: always derive the position with MATCH or XMATCH.

Related functions

  • MATCH. Supplies the position. The INDEX and MATCH pair works in every version of Excel.
  • XMATCH. The same job as MATCH with an exact match by default and a last-to-first search. The better pointer in Excel 2021 and 365.
  • OFFSET. Builds the same moving ranges, volatile. Replace it with INDEX wherever the range is built from a start cell and a count.
  • XLOOKUP. Returns a value directly from a key. Reach for it on a one-way lookup and keep INDEX for grids and range ends.
  • TAKE. Returns the first or last n rows or columns of an array, a shorter way to write some INDEX range ends in Excel 365.
  • The play avoid volatile functions explains why INDEX replaces OFFSET in the calculation layer.

All functions