Lookup & Reference

OFFSET Formula

OFFSET returns a cell or range reference that is a specified number of rows and columns away from a starting reference. It can also define a range of a given height and width. OFFSET is powerful for building dynamic ranges, but it is volatile — recalculating every time the sheet changes.

Syntax

OFFSET(reference, rows, cols, [height], [width])
ParameterDescription
reference Parameter of the OFFSET function.
rows Parameter of the OFFSET function.
cols Parameter of the OFFSET function.
[height] (Optional.) Parameter of the OFFSET function.
[width] (Optional.) Parameter of the OFFSET function.
Try OFFSET in Viztab — free, no signup

Examples

Dynamic reference

Formula
=OFFSET(A1, 3, 2)
Returns the value in cell C4 — starting from A1, moving 3 rows down and 2 columns right.

Dynamic SUM range

Formula
=SUM(OFFSET(A1, 0, 0, COUNTA(A:A), 1))
Sums all non-empty cells in column A by creating a dynamic range whose height equals the count of non-empty cells.

Moving average

Formula
=AVERAGE(OFFSET(B10, -4, 0, 5, 1))
Averages cells B6:B10 — starts at B10, goes up 4 rows, and creates a 5-row range. Useful for a trailing 5-period average.

Common Errors

#REF!

Occurs when the offset would move the reference outside the worksheet boundaries (negative row/column result or beyond sheet limits).

#VALUE!

Occurs when the height or width argument is zero or non-numeric.

Tips

Volatile function

OFFSET recalculates on every change, even if its inputs haven't changed. In large workbooks, excessive use of OFFSET can slow things down. Consider INDEX as a non-volatile alternative.

Use for dynamic named ranges

OFFSET is commonly used in named range definitions to create ranges that automatically expand as data grows: =OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),1).

Height and width

The optional 4th and 5th arguments define a multi-cell range. OFFSET(A1,0,0,5,3) creates a reference to A1:C5. Without them, OFFSET returns a single cell.

Try OFFSET in Viztab

Import your data and use OFFSET with 370+ other formulas. No signup required.

Open Viztab

Related Formulas