Excel OFFSET: What It Is and How to Use It
In this article
The Excel OFFSET function returns a reference to a range that is a specified number of rows and columns from a starting cell or range. In plain terms, it lets you build a dynamic range that shifts based on a number you supply. For example, =OFFSET(A1,3,2) returns the cell three rows down and two columns to the right of A1, which is C4. It is a standard, built-in worksheet function in Microsoft Excel and Google Sheets, not slang or informal terminology. The name comes directly from its purpose: it offsets, or moves, a reference by a given number of rows and columns. You will see it used in formulas like =SUM(OFFSET(A1,0,0,5,1)) to sum the first five cells in column A, where the size of the range is also controlled by OFFSET arguments.
What Does OFFSET Actually Return?
OFFSET returns a reference, not a value. That reference can be a single cell or a multi-cell range, depending on the optional height and width arguments. The function has five arguments, three of which are required:
- Reference (required): the starting point. It can be a cell reference like A1 or a named range.
- Rows (required): the number of rows to move down (positive) or up (negative) from the reference.
- Cols (required): the number of columns to move right (positive) or left (negative) from the reference.
- Height (optional): the number of rows in the returned range. If omitted, the height matches the reference.
- Width (optional): the number of columns in the returned range. If omitted, the width matches the reference.
For instance, =OFFSET(A1,1,1,3,2) returns a range that starts at B2 and includes B2:C4 (three rows high, two columns wide). If you wrap that in SUM, =SUM(OFFSET(A1,1,1,3,2)) adds the six values in that block. The key thing to remember is that OFFSET does not move anything on the sheet; it only tells Excel which cells to look at for the rest of the formula.
How to Use OFFSET in a Real Formula
The most common use is creating a dynamic range that grows or shrinks with your data. Suppose you have monthly sales in column A, from A1 to A10, and you add a new row each month. A static SUM like =SUM(A1:A10) will miss the new value. With OFFSET, you can write =SUM(OFFSET(A1,0,0,COUNTA(A:A),1)). Here, COUNTA(A:A) counts all non-empty cells in column A, so the height argument automatically adjusts. If you add a value in A11, the range becomes A1:A11 and the sum updates.
Another typical use is retrieving the last value in a list. =OFFSET(A1,COUNTA(A:A)-1,0) returns the last non-empty cell in column A. The formula counts how many entries there are, subtracts one because you start at A1, and moves down that many rows. This is handy for dashboards that need to show the most recent data point.
OFFSET also works with charts and data validation. For a chart, you can define a named range like =OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),1) and use that name as the chart's data source. The chart then updates automatically when you add rows. For data validation, you can use OFFSET to create a dropdown list that only shows the current items in a list.
How to Choose the Right OFFSET Arguments
Getting the rows, cols, height, and width right is the hardest part. A simple way to think about it: rows and cols tell OFFSET where to start, and height and width tell it how big the range should be. If you want to start at the top of a data table, set rows and cols to 0 so you stay at the reference. If you want to skip a header row, set rows to 1. For example, if your data starts in row 2 because row 1 has headers, =OFFSET(A2,0,0,COUNTA(A2:A100),1) starts at A2 and counts only the data rows.
When using COUNTA, be careful: if there are blank cells in the middle of the list, COUNTA will count them as zero and the range will be too short. A more robust approach is to use a structured reference like =OFFSET(Table1[Sales],0,0,ROWS(Table1[Sales]),1) if your data is in an Excel Table. Tables automatically expand, so you may not need OFFSET at all. But if you are using a plain range, test with a few blank cells to see if the count works.
Also consider whether OFFSET is the best tool. Excel has INDEX, which is non-volatile and often faster. For a dynamic range, =INDEX(A:A,COUNTA(A:A)) returns the last value without OFFSET. Use OFFSET when you need to shift the starting point as well as the size, or when you are building a range that moves over time, like a rolling 12-month window.
Common Problems and How to Fix Them
The most frequent issue is the #VALUE! error. This happens when OFFSET tries to return a range that goes outside the worksheet boundaries. For example, =OFFSET(A1,-1,0) tries to go above row 1, which does not exist. Check your rows and cols arguments for negative numbers that push the reference off the sheet. Also, if height or width is zero or negative, you will get a #REF! error. Make sure those arguments are positive integers.
Another common problem is that OFFSET is a volatile function. It recalculates every time Excel changes anything on the sheet, which can slow down large workbooks. If you have hundreds of OFFSET formulas, consider replacing them with INDEX or using manual calculation mode (Formulas > Calculation Options > Manual) to reduce recalculation. Volatility is not an error, but it can make your workbook sluggish.
A third issue is that OFFSET returns a reference that may be a multi-cell range, and if you use it in a formula that expects a single value, you get a #VALUE! error. For instance, =OFFSET(A1,0,0,5,1)+1 will fail because you cannot add 1 to five cells at once. Wrap it in SUM or use it in an array formula if you intend to process multiple cells.
Finally, if you copy an OFFSET formula down a column, the reference will change relative to the new location unless you use absolute references. If you want the starting point to stay fixed, use $A$1 instead of A1. This is a classic mistake that causes the range to drift as you fill down.
OFFSET vs. INDEX vs. INDIRECT
These three functions are often compared because they all create dynamic references, but they work differently. INDEX returns the value at a specific row and column within a range, and it is non-volatile. For example, =INDEX(A1:A10,5) returns the 5th value in A1:A10. INDEX can also return a reference, but it is less flexible than OFFSET when you need to shift the starting point. However, INDEX is faster and does not cause recalculation issues.
INDIRECT returns a reference from a text string, like =INDIRECT("A"&B1) where B1 contains a row number. INDIRECT is also volatile and can be slower, but it is useful when you need to build a reference from text. OFFSET is more direct because you supply numbers, not text, and it can return a range of any size. The choice depends on your need: use INDEX for simple lookups, OFFSET for shifting ranges, and INDIRECT when you must build the reference from a string.
In practice, many Excel experts recommend avoiding OFFSET and INDIRECT because they are volatile and can make workbooks unstable. Instead, use INDEX with MATCH for lookups, and use Excel Tables for dynamic ranges. But OFFSET is still taught and used because it is intuitive for moving ranges, especially in financial modeling and dashboards.
Safety and Performance Considerations
OFFSET itself is not dangerous, but it can cause problems if used carelessly. The biggest risk is performance: because OFFSET is volatile, every change to the sheet triggers recalculation of all OFFSET formulas. In a large workbook with thousands of formulas, this can make Excel unresponsive. To mitigate, limit the number of OFFSET formulas and use them only where necessary. You can also press F9 to manually recalculate if you set calculation to manual.
Another safety concern is that OFFSET can return a range that includes unintended cells if your height or width arguments are too large. For example, if you use =OFFSET(A1,0,0,COUNTA(A:A),1) and column A has stray numbers in rows below your data, the sum will include them. Always check the range that OFFSET returns by selecting it in the formula bar and pressing F9, or by using the Evaluate Formula tool (Formulas > Evaluate Formula).
When using OFFSET with data validation, be aware that the list will not update if you add rows at the end unless the COUNTA formula is correct. Also, if you delete rows, the OFFSET reference may shift and break. A safer alternative is to use a named range with a Table, which handles expansion automatically.
Frequently Asked Questions
Is OFFSET a volatile function?
Yes, OFFSET is volatile. It recalculates whenever any change is made to the worksheet, even if the change does not affect the OFFSET formula. This can slow down large workbooks. If performance is a concern, consider using INDEX instead, which is non-volatile.
Can OFFSET return a whole column or row?
Yes, you can set height or width to the total number of rows or columns in the sheet, but that is rarely practical. More commonly, you use COUNTA or a similar function to determine the exact size. For example, =OFFSET(A1,0,0,COUNTA(A:A),1) returns the used range in column A.
What is the difference between OFFSET and INDEX?
OFFSET returns a reference that can be moved and resized, while INDEX returns a value or a reference at a specific position. OFFSET is more flexible for shifting ranges, but INDEX is faster and non-volatile. Use INDEX for lookups and OFFSET for dynamic ranges that need to move.
Why does my OFFSET formula return #REF!?
The #REF! error occurs when the reference, rows, cols, height, or width arguments cause the range to extend outside the worksheet. For example, a negative rows argument that goes above row 1, or a height that goes past the last row. Check your arguments and make sure they stay within the sheet boundaries.
Can I use OFFSET in Google Sheets?
Yes, OFFSET works in Google Sheets with the same syntax and behavior. It is also volatile in Google Sheets, so the same performance considerations apply. The function is documented in Google's help center.
How do I see what range OFFSET returns?
Select the cell with the OFFSET formula, then in the formula bar highlight the OFFSET part and press F9. Excel will show the resulting range as a value or a reference. To cancel, press Esc. This is a quick way to verify your arguments are correct.