
Section: Excel & Google Sheets
The OFFSET function in Excel returns a range that sits a set number of rows and columns away from a starting cell. =OFFSET(A1,2,1) points at B3. Add a height and a width and it returns a block instead of one cell. People use it to build ranges that grow as data is added, to total the last few rows of a list, and to reach a value found by a lookup. This guide covers the syntax, the patterns worth knowing and the reason OFFSET can make a large workbook slow. The sample data is made up.
What OFFSET returns
OFFSET does not return a value. It returns a reference, a cell or a block of cells, and whatever you wrap around it decides what happens next. That is why it is nearly always used inside another function such as SUM, AVERAGE, COUNT or MATCH. On its own in a cell it shows the value of the reference, which can be confusing until you see the pattern.
The syntax
=OFFSET(reference, rows, cols, [height], [width])
- reference is the starting cell or range. It must be a real cell or a block of adjacent cells, or the function returns #VALUE!.
- rows is how far up or down to move. Positive goes down, negative goes up.
- cols is how far left or right to move. Positive goes right, negative goes left.
- height is optional and sets how many rows the result covers. It must be positive.
- width is optional and sets how many columns the result covers.
If height or width is left out, the result is the same size as the reference. If the move takes you past the edge of the sheet, you get #REF!. Microsoft's documentation states both of these plainly, and they explain most of the errors people meet.

A first example
Suppose A1 holds a label and the numbers you care about start in A2. =OFFSET(A1,1,0) returns A2, the cell one row below. =OFFSET(A1,1,0,3,1) returns A2:A4, a block three rows tall. Wrap it in SUM and you have the total of the first three values, and changing the 3 changes how many rows are included.
Build a range that grows
The classic use is a dynamic range. =SUM(OFFSET($A$2,0,0,COUNTA($A$2:$A$1000),1)) starts at A2, takes as many rows as there are entries and adds them up. This assumes contiguous entries with no internal blanks and no more than 999 entries. COUNTA also counts formulas returning empty strings, so verify what your source contains. The same block can feed a chart series or a named range.

Total the last N rows
For a contiguous list containing at least five entries, to total its last five rows, count the rows and step back:
=SUM(OFFSET($B$2,COUNTA($B$2:$B$1000)-5,0,5,1))
The rows argument moves the start of the block to the fifth row from the bottom, and the height of 5 takes the last five. Swap SUM for AVERAGE and you have a rolling average. This is the pattern behind most rolling total sheets, and it is worth building once and reusing.
OFFSET with MATCH
MATCH finds a position, and OFFSET turns that position into a reference. If A2:A100 holds product codes and C1:Z1 holds months, then =OFFSET($C$1,MATCH("P-204",$A$2:$A$100,0),MATCH("Jun",$C$1:$Z$1,0)-1) returns the value at the crossing point. It is a two way lookup, and it is the older cousin of the INDEX MATCH pattern.

Why OFFSET can be slow
OFFSET is a volatile function. It recalculates every time anything in the workbook changes, even when nothing it depends on has moved. A few OFFSET formulas are harmless. Hundreds of them across large sheets turn every keystroke into a recalculation, and the file starts to lag. If a workbook feels heavy and it uses OFFSET widely, that is a likely cause.
OFFSET or INDEX
INDEX does the same job without the volatility. =SUM(INDEX(A:A,1):INDEX(A:A,COUNTA(A:A))) gives a dynamic range, and =SUM(INDEX(B2:B1000,COUNTA(B2:B1000)-4):INDEX(B2:B1000,COUNTA(B2:B1000))) gives the last five entries. On big models, prefer INDEX. Keep OFFSET for cases where its relative movement makes the formula much shorter, such as a small report block that shifts by one row each month.
Turn it into a named range
A dynamic range is easier to use when it has a name. Open Formulas, then Name Manager, then New, and set Refers to with the OFFSET formula, for example =OFFSET(Sheet1!$A$2,0,0,COUNTA(Sheet1!$A$2:$A$1000),1). Call it SalesData. From then on every chart, PivotTable source and formula can use SalesData instead of a fixed range, and the block resizes as rows are added. Named ranges also make a formula readable, which matters when someone else has to maintain the file.

Errors and fixes
- #REF! The move went off the edge of the sheet. Check the rows and cols numbers, especially the negative ones.
- #VALUE! The reference is not a cell or a block of adjacent cells, or height and width are not positive numbers.
- The total is short by a few rows. COUNTA counts non empty cells, so an internal blank reduces the count and can omit a later row from the calculated range. Use a fixed height or clean the gaps.
- The result changes when a column is inserted. OFFSET is relative to its reference, so inserting rows or columns moves the target. Dollar signs control copying, not all structural changes. Check the new target after inserting columns or rows; use named columns where possible.
Questions and answers
Can OFFSET return a whole column?
Yes, if you give a height large enough, but that is a slow way to work. Reference the column directly instead.
Does OFFSET work with SUMIF and COUNTIF?
It can, because it returns a reference, but the range arguments in those functions are easier to read when written out. For the pattern, see our guide to SUMIF.
Is OFFSET available in Google Sheets?
Google Sheets also has OFFSET. Check its own documentation before transferring workbook-specific behaviour.
Why use OFFSET at all if INDEX is faster?
For small report blocks, OFFSET is shorter to write and easier to explain. Speed only matters when the formula count is high.
Can OFFSET create a reference another formula uses?
Yes. Combined with INDIRECT or a defined name it can point at a block that moves, which is how some dashboards switch between months.
