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])| Argument | What it means | |
|---|---|---|
reference | Required | The starting cell or range. |
rows | Required | How many rows to move: positive goes down, negative goes up, 0 stays. |
cols | Required | How many columns to move: positive goes right, negative goes left. |
height | Optional | Height of the returned range in rows. Defaults to the height of reference. |
width | Optional | Width 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
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Month | Sales | ||
| 2 | Jan | 8200 | 9150 | |
| 3 | Feb | 9150 | ||
| 4 | Mar | 10400 | ||
| 5 | Apr | 9800 | ||
| 6 | May | 11250 | ||
| 7 | Jun | 12030 |
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
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Month | Sales | ||
| 2 | Jan | 8200 | 33080 | |
| 3 | Feb | 9150 | ||
| 4 | Mar | 10400 | ||
| 5 | Apr | 9800 | ||
| 6 | May | 11250 | ||
| 7 | Jun | 12030 |
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
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Month | Sales | |||
| 2 | Jan | 8200 | Jan | 8200 | |
| 3 | Feb | 9150 | Feb | 9150 | |
| 4 | Mar | 10400 | |||
| 5 | Apr | 9800 | |||
| 6 | May | 11250 | |||
| 7 | Jun | 12030 |
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.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#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.
| Language | Function name |
|---|---|
| Czech | POSUN |
| Danish | FORSKYDNING |
| Dutch | VERSCHUIVING |
| Finnish | SIIRTYMÄ |
| French | DECALER |
| German | BEREICH.VERSCHIEBEN |
| Hungarian | ELTOLÁS |
| Italian | SCARTO |
| Norwegian (Bokmål) | FORSKYVNING |
| Polish | PRZESUNIĘCIE |
| Portuguese (Brazil) | DESLOC |
| Portuguese (Portugal) | DESLOCAMENTO |
| Russian | СМЕЩ |
| Spanish | DESREF |
| Swedish | FÖRSKJUTNING |
| Turkish | KAYDIR |