OFFSET function in Google Sheets
Returns a range reference shifted a specified number of rows and columns from a starting cell reference.
=OFFSET(cell_reference, offset_rows, offset_columns, [height], [width])OFFSET syntax and parameters
Five arguments, three required.
- cell_referencerangeRequired
The starting point from which to count the offset rows and columns.
- offset_rowsnumberRequired
The number of rows to shift by. offset_rows must be an integer, but may be negative. If a decimal value is provided, the decimal part will be truncated.
- offset_columnsnumberRequired
The number of columns to shift by. offset_columns must be an integer, but may be negative. If a decimal value is provided, the decimal part will be truncated.
- heightnumberOptional
[ OPTIONAL ] - The height of the range to return starting at the offset target.
- widthnumberOptional
[ OPTIONAL ] - The width of the range to return starting at the offset target.
OFFSET examples
Formulas you'll actually reuse.
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))Result
13110Total a whole column picked by its header label:
=SUM(OFFSET(A1, 1, MATCH("Q3", A1:E1, 0) - 1, 12, 1))Result
48900
OFFSET in Excel
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.
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.
Related functions
More ways Google Sheets gets this done.
- ADDRESSReturns a cell reference as a string.LookupExcel
- CHOOSEReturns an element from a list of choices based on index.LookupExcel
- COLUMNReturns the column number of a specified cell, with `A=1`.LookupExcel
- COLUMNSReturns the number of columns in a specified array or range.LookupExcel
- FORMULATEXTReturns the formula as a string. .LookupExcel
- GETPIVOTDATAExtracts an aggregated value from a pivot table that corresponds to the specified row and column headings.LookupExcel