Skip to content
Excel

OFFSET function in Excel

Returns a reference offset from a given reference

=OFFSET(reference, rows, cols, [height], [width])

OFFSET syntax and parameters

Five arguments, three required.

  • referencerangeRequired

    The reference from which you want to base the offset. Reference must refer to a cell or range of adjacent cells; otherwise, OFFSET returns the #VALUE! error value.

  • rowsnumberRequired

    The number of rows, up or down, that you want the upper-left cell to refer to. Using 5 as the rows argument specifies that the upper-left cell in the reference is five rows below reference. Rows can be positive (which means below the starting reference) or negative (which means above the starting reference).

  • colsnumberRequired

    The number of columns, to the left or right, that you want the upper-left cell of the result to refer to. Using 5 as the cols argument specifies that the upper-left cell in the reference is five columns to the right of reference. Cols can be positive (which means to the right of the starting reference) or negative (which means to the left of the starting reference).

  • heightnumberOptional

    The height, in number of rows, that you want the returned reference to be. Height must be a positive number.

  • widthnumberOptional

    The width, in number of columns, that you want the returned reference to be. Width must be a positive number.

OFFSET examples

Formulas you'll actually reuse.

  1. Average of the last three entries in column B — a rolling window that grows with the data:

    =AVERAGE(OFFSET(B1, COUNTA(B:B) - 3, 0, 3, 1))

    Result13110

  2. Total a whole column picked by its header label:

    =SUM(OFFSET(A1, 1, MATCH("Q3", A1:E1, 0) - 1, 12, 1))

    Result48900

OFFSET in Google Sheets

Same name — your formula ports as-is.

Try OFFSET in the playground

Edit the example — nothing to install.

Preloaded with the OFFSET formula from Example 1 — change anything and watch it respond.

Loading the editor…

OFFSET errors

What they mean — and the fixes.

  • #REF!

    The offset lands outside the sheet (a negative row or column from the top-left corner), or height/width is 0.