Lookup & reference function

OFFSET function

Returns a reference shifted a given number of rows and columns from a starting cell, optionally resized to a new height and width.

Available in All versions of Excel, including Microsoft 365, Excel for the web and Excel for Mac

In every Excel versionWorks in Google Sheets

Syntax

OFFSET(reference, rows, cols, [height], [width])
ArgumentWhat it means
referenceRequiredThe starting cell or range.
rowsRequiredHow many rows to move: positive goes down, negative goes up, 0 stays.
colsRequiredHow many columns to move: positive goes right, negative goes left.
heightOptionalHeight of the returned range in rows. Defaults to the height of reference.
widthOptionalWidth of the returned range in columns. Defaults to the width of reference.

Returns: A reference to a cell or range. On its own it shows the value(s); inside SUM, AVERAGE and similar it supplies the range.

How OFFSET works

OFFSET works like giving directions: start at this cell, go down so many rows, across so many columns, and take a block this tall and this wide. The result is a reference, which means you can feed it straight into SUM, AVERAGE or a chart range. The classic uses are rolling totals ("the last 3 months"), ranges that grow as data is added, and picking a value by position.

The starting cell itself is never counted as a step: OFFSET(A1, 2, 1) moves two rows down and one column right, landing on B3. If you give height and width, OFFSET returns a block of that size whose top-left corner is the landing cell. In Microsoft 365 a multi-cell result typed into a single cell spills.

OFFSET is volatile - it recalculates after every change in the workbook - and its ranges are invisible to tools like Trace Precedents. For most dynamic-range needs, INDEX (as in B2:INDEX(B:B, n)), TAKE or a formatted table are faster and easier to audit.

Examples

1Move from a starting cell

D2fx=OFFSET(A1, 2, 1)
ABCD
1MonthSales
2Jan82009150
3Feb9150
4Mar10400
5Apr9800
6May11250
7Jun12030

Result: 9150

From A1 go 2 rows down (A3) and 1 column right: cell B3, February's sales.

2Rolling total of the last 3 months

D2fx=SUM(OFFSET(B2, COUNT(B2:B7)-3, 0, 3, 1))
ABCD
1MonthSales
2Jan820033080
3Feb9150
4Mar10400
5Apr9800
6May11250
7Jun12030

Result: 33080

There are 6 numbers, so OFFSET moves 3 rows down from B2 to B5 and takes a block 3 rows tall: B5:B7 (Apr-Jun). 9800 + 11250 + 12030 = 33080. Add July in B8 and widen the COUNT range to keep it rolling.

3Return a block that spills

D2fx=OFFSET(A1, 1, 0, 2, 2)
ABCDE
1MonthSales
2Jan8200Jan8200
3Feb9150Feb9150
4Mar10400
5Apr9800
6May11250
7Jun12030

Start at A1, move 1 row down to A2, then take 2 rows by 2 columns. In Microsoft 365 the four values spill into D2:E3.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 16 KB

Common errors and how to fix them

ErrorWhy it happensFix
#REF!The shifted range would fall off the sheet, e.g. moving up from row 1.Check the row and column offsets.
#VALUE!height or width is 0 or negative in a version that does not allow it.Use positive sizes.
#SPILL!A multi-cell result has no room to spill.Clear the cells below/right of the formula, or wrap OFFSET in an aggregate such as SUM.

Tips

  • =AVERAGE(OFFSET(B2, 0, 0, E1, 1)) averages the first n months, where n is typed in E1.
  • Because OFFSET is volatile, prefer INDEX: =SUM(INDEX(B2:B7, 4):B7) sums the same last three months without volatility.
  • In Microsoft 365, =SUM(TAKE(B2:B7, -3)) is the simplest rolling total.

Questions

Is OFFSET bad to use?

It is not wrong, but it is volatile and hard to audit. In big workbooks, INDEX-based ranges or TAKE/DROP are better.

Does OFFSET count the starting cell?

No. Moving 0 rows and 0 columns returns the starting cell itself; 1 row moves to the next row.

Google Sheets

OFFSET also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

OFFSET in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
CzechPOSUN
DanishFORSKYDNING
DutchVERSCHUIVING
FinnishSIIRTYMÄ
FrenchDECALER
GermanBEREICH.VERSCHIEBEN
HungarianELTOLÁS
ItalianSCARTO
Norwegian (Bokmål)FORSKYVNING
PolishPRZESUNIĘCIE
Portuguese (Brazil)DESLOC
Portuguese (Portugal)DESLOCAMENTO
RussianСМЕЩ
SpanishDESREF
SwedishFÖRSKJUTNING
TurkishKAYDIR

Recipes that use OFFSET