
Return a reference that is a specified number of rows and columns away from a starting cell or range. OFFSET is useful for dynamic ranges, rolling calculations, and reference shifting.
The Excel OFFSET function returns a reference that is a specified number of rows and columns from a starting reference. It can return either a single cell or a larger range, depending on whether you also provide height and width arguments.
That makes OFFSET useful when the location of the target range is not fixed. Instead of hard-coding one address, you can describe how far to move from an anchor cell and how large the returned range should be.
OFFSET is powerful, but it is also a volatile function. That means it recalculates whenever Excel recalculates, so in very large workbooks it can affect performance if used heavily.
Returns a cell or range by shifting from an anchor reference by a specified number of rows and columns.
Returns a reference, not a final value by itself, so it is often wrapped inside functions such as SUM, AVERAGE, or COUNTA.
=OFFSET(reference, rows, cols, [height], [width])
reference is the starting point, rows and cols tell Excel how far to move, and the optional height and width arguments define the size of the returned range.
If height and width are omitted, OFFSET returns a reference of the same size as the original reference. If the shift moves the reference outside the worksheet, Excel returns #REF!.
Because OFFSET returns a reference, it is often easier to understand if you picture the function in two steps: first move to a new top-left position, then resize the returned range if height or width is provided.
OFFSET is often compared with functions that also help build dynamic references, but the way it works is different.
| Function | Main Role | Use When |
|---|---|---|
OFFSET |
Shift and resize a reference | You want to describe a range relative to an anchor cell or range |
INDEX |
Return a value or reference by position | You want a non-volatile alternative for many lookup patterns |
ADDRESS |
Build a reference as text | You need a text address rather than a shifted live reference |
INDIRECT |
Evaluate text as a reference | You already have a text address and need Excel to resolve it |
OFFSET is often the clearest choice when the reference should be defined relative to a starting point. If performance matters and the pattern can be expressed another way, INDEX is often worth considering.
One common use of OFFSET is rolling calculations. For example, a workbook might need the last 3 rows, the next 12 months, or a moving summary window that changes over time. OFFSET can describe that moving range without rewriting the formula each time.
Another use is dynamic named ranges. If the size of a list changes, OFFSET can return a range whose height or width depends on another formula such as COUNTA.
The main caution is volatility. OFFSET recalculates frequently, so using it in many cells across a very large workbook can slow calculation. That does not make the function wrong, but it does mean it should be used deliberately.
This pattern uses OFFSET to return a moving block of rows and then passes that block to another function. It is useful when the start of the calculation window needs to shift over time.
=SUM(OFFSET(A1, COUNTA(A:A)-3, 0, 3, 1))
Starting from A1, return the value 1 row down. Formula: =OFFSET(A1, 1, 0).
Here OFFSET moves one row down and one column right from A1, which lands on B2, and then returns a 2 by 2 block. Wrapping that range in SUM adds the values in B2:C3.
=SUM(OFFSET(A1, 1, 1, 2, 2))
Starting from A1, return the value 2 columns to the right. Formula: =OFFSET(A1, 0, 2).
This example uses a count stored in B5 as the height argument. As the count changes, the returned range grows or shrinks without changing the formula itself.
=OFFSET(A1, 0, 0, B5, 1)
Sum a range that starts at A1 and is 3 rows high and 1 column wide. Formula: =SUM(OFFSET(A1, 0, 0, 3, 1)).
OFFSET can also be used with negative movement. Starting from A10 and moving up 5 rows returns A5, which shows that the function can move in either direction from the anchor cell.
=OFFSET(A10, -5, 0)
Starting from A10, return the value 5 rows up. Formula: =OFFSET(A10, -5, 0).
OFFSET returns a shifted and optionally resized reference.=OFFSET(reference, rows, cols, [height], [width]).Tell your friends about this post