ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Lookups
  3. OFFSET Function in Excel: Move and Resize a Range

OFFSET Function in Excel: Move and Resize a Range

By ExcelReady Team·Updated November 2, 2026·6 min read

The short answer

OFFSET returns a cell or range that is a given number of rows and columns away from a starting cell, with an optional new height and width. Write =OFFSET(reference, rows, cols, [height], [width]). For example, =SUM(OFFSET(B1,4,0,3,1)) adds B5:B7. OFFSET is volatile, so INDEX is often a faster choice.

Key takeaways

  • Syntax: =OFFSET(reference, rows, cols, [height], [width]). Rows and cols say how far to move; height and width set the size.
  • Positive rows move down and positive cols move right; negative values move up or left.
  • OFFSET returns a reference, so you usually wrap it in SUM, AVERAGE or COUNT.
  • It is volatile: it recalculates after every change, which can slow big files.
  • INDEX can do most OFFSET jobs without being volatile.
On this page+
  1. What does the OFFSET function do?
  2. OFFSET examples: move, then resize
  3. How to sum the last N months with OFFSET
  4. Why OFFSET can slow a workbook: volatility
  5. How to do the same thing with INDEX
  6. Common uses: running totals and dynamic ranges
  7. Why OFFSET returns #REF! or the wrong range
  8. Practise it

The OFFSET function in Excel starts at one cell, moves a set number of rows and columns, and returns the cell or range it lands on, at whatever size you ask for. That makes it useful for "the last 3 months", moving averages and ranges that grow as you add data. This guide explains the syntax with small examples, the volatility catch, and when INDEX does the same job better.

What does the OFFSET function do?#

OFFSET returns a reference: an address of a cell or range, not a value. Think of it as giving directions: "start at B1, go 4 rows down and 0 columns across, then take a block 3 rows tall and 1 column wide."

Excel formula
=OFFSET(reference, rows, cols, [height], [width])
ArgumentWhat it meansExample
referenceThe starting cellB1
rowsHow many rows to move down (negative moves up)4
colsHow many columns to move right (negative moves left)0
heightOptional. How many rows tall the result is3
widthOptional. How many columns wide the result is1

If you leave out height and width, the result is the same size as the starting reference. OFFSET works in every version of Excel.

All the examples use this monthly sales list:

AB
1MonthSales
2Jan4,200
3Feb3,900
4Mar5,100
5Apr4,800
6May5,600
7Jun6,100

OFFSET examples: move, then resize#

Return one cell#

Excel formula
=OFFSET(B1,3,0)

Start at B1, move 3 rows down, stay in the same column. That lands on B4, so the result is 5,100 (March). Moving 0 rows returns B1 itself.

Return a range and add it up#

Because OFFSET returns a range, wrap it in a function such as SUM:

Excel formula
=SUM(OFFSET(B2,0,0,3,1))

Start at B2, don't move, and take a block 3 rows tall and 1 column wide: B2:B4. The result is 4,200 + 3,900 + 5,100 = 13,200, the first quarter. The SUM function guide covers the basics of adding ranges.

In Microsoft 365, typing =OFFSET(B2,0,0,3,1) on its own spills the three values into the cells below. In older versions it shows #VALUE!, which is why you'll often see OFFSET inside SUM, AVERAGE or COUNT.

How to sum the last N months with OFFSET#

The classic OFFSET job is a total that always covers the latest months, even as new rows are added. Use COUNT to find how many months there are:

Excel formula
=SUM(OFFSET(B1,COUNT(B2:B7)-2,0,3,1))
  • COUNT(B2:B7) is 6 months.
  • 6-2 = 4, so the start moves from B1 down to B5.
  • Height 3 makes the range B5:B7.

The result is 4,800 + 5,600 + 6,100 = 16,500. When you type July into row 8 (and widen the COUNT range), the window slides to May–July by itself.

A moving average works the same way. In C4, =AVERAGE(OFFSET(B4,-2,0,3,1)) averages B2:B4 (4,400), and filling it down makes each row average itself and the two rows above. The guide to calculating a moving average shows simpler ways too.

Why OFFSET can slow a workbook: volatility#

OFFSET is a volatile function. A volatile function recalculates every time anything in the workbook changes, even a cell it doesn't use. TODAY, NOW and INDIRECT behave the same way.

A handful of OFFSET formulas is fine. Thousands of them, or OFFSET inside a big lookup, can make a file lag after every keystroke. OFFSET formulas are also harder to audit, because you can't click the range they point to; you have to work out the directions in your head.

That doesn't make OFFSET wrong. It just means that for large or shared models, a non-volatile alternative is worth knowing.

How to do the same thing with INDEX#

INDEX returns the cell at a position inside a range, and it is not volatile. Most OFFSET formulas have an INDEX version:

TaskOFFSETINDEX alternative
4th value in the list=OFFSET(B1,4,0)=INDEX(B2:B7,4)
Latest value=OFFSET(B1,COUNT(B2:B7),0)=INDEX(B2:B7,COUNT(B2:B7))
Last 3 values=SUM(OFFSET(B1,COUNT(B2:B7)-2,0,3,1))=SUM(INDEX(B2:B7,COUNT(B2:B7)-2):INDEX(B2:B7,COUNT(B2:B7)))

The last row uses a lesser-known trick: two INDEX results joined by a colon form a range, here B5:B7. Both versions return 16,500. The INDEX function guide explains the arguments, and the full guide to the INDEX function shows more ways to pick values by position.

In Microsoft 365 or Excel 2024 there is an even shorter option: =SUM(TAKE(B2:B7,-3)), where TAKE with a negative number returns the last 3 rows.

Common uses: running totals and dynamic ranges#

You'll meet OFFSET in older files in two other places.

Running totals. Some files use =SUM(OFFSET($B$2,0,0,ROW()-1,1)). A plain expanding range, =SUM($B$2:B2) filled down, does the same thing and is easier to read. The guide to running totals walks through it.

Dynamic named ranges. Before Excel tables and spill ranges existed, a named range like this grew with a list in column A:

Excel formula
=OFFSET($A$2,0,0,COUNTA($A:$A)-1,1)

It starts at A2 and is as tall as the number of filled cells minus the header. People used it as the source of a drop-down list. Today, an Excel table or a spill reference is usually simpler; see how to make a dynamic drop-down list.

Why OFFSET returns #REF! or the wrong range#

Check these when the result looks wrong:

  • #REF!: the range runs off the sheet, such as =OFFSET(A1,-1,0), or the height or width is 0.
  • Off by one. The starting cell counts as 0, so OFFSET(B1,1,0) is B2, one row below the start. Many mistakes come from starting at the header row or the first data row without adjusting.
  • Blank cells in the COUNT range. A gap makes COUNT too small, so the window ends early.
  • #VALUE! in older Excel: a multi-cell OFFSET on its own needs a wrapper like SUM.

Practise it#

OFFSET is mostly about counting positions, and INDEX uses the same skill without the volatility. Practise INDEX and MATCH in a live spreadsheet: you'll pick values by position and build lookups, with each answer checked instantly. If ranges and totals are new to you, start with the SUM and AutoSum lesson. The INDEX MATCH guide is a good next read.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Get the latest month's sales without OFFSET. In D2, use INDEX on B2:B7 with COUNT(B2:B7) as the row number. (OFFSET(B1,COUNT(B2:B7),0) would return the same cell.)

fx
ABCDE
1
Month
Sales
2
Jan
4200
Latest month
3
Feb
3900
4
Mar
5100
5
Apr
4800
6
May
5600
7
Jun
6100
8
9
10

Tip: COUNT(B2:B7) is 6, the number of months filled in. INDEX(B2:B7,6) returns the 6th value.

Practise this in a lesson

LessonINDEX and MATCHCombine INDEX and MATCH to look up in any direction, including returning a column to the left of the one you search.LessonSUM and AutoSumAdd up a column of numbers with SUM, then let AutoSum write the formula for you.Function guideINDEXLearn the Excel INDEX function: return a value by row and column position, build two-way lookups with MATCH, and practice live.Function guideSUMAdd up columns, rows and separate ranges with Excel's SUM function. Clear examples, common mistakes and a live practice exercise.

Frequently asked questions

What does the OFFSET function do in Excel?

+

OFFSET starts at a cell, moves a number of rows and columns, and returns the cell or range it lands on. You can also set how tall and wide that range is. It is often used for rolling sums, moving averages and ranges that grow.

Why is OFFSET called volatile?

+

A volatile function recalculates every time anything in the workbook changes, not just when its own inputs change. OFFSET, INDIRECT, TODAY and NOW are all volatile. A few are fine, but thousands can make a file slow.

What can I use instead of OFFSET?

+

INDEX is the usual replacement. INDEX(B2:B7,4) returns the same cell as OFFSET(B1,4,0), and INDEX(...):INDEX(...) builds a range. In Microsoft 365 or Excel 2024, TAKE and DROP also return the first or last rows of a range.

Why does OFFSET return #REF!?

+

The range it points to falls off the edge of the sheet, for example moving up from row 1 or left from column A. A height or width of 0 also gives #REF!.

Does OFFSET work in older versions of Excel?

+

OFFSET works in every version of Excel. If it returns a multi-cell range on its own, Microsoft 365 spills the values into nearby cells, while older versions need it wrapped in a function such as SUM.

Sources

  • INDEX function - Microsoft Support
  • SUM function - Microsoft Support
  • Define and use names in formulas - Microsoft Support

Written and checked by the ExcelReady Team. First published November 2, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What does the OFFSET function do?
  2. OFFSET examples: move, then resize
  3. How to sum the last N months with OFFSET
  4. Why OFFSET can slow a workbook: volatility
  5. How to do the same thing with INDEX
  6. Common uses: running totals and dynamic ranges
  7. Why OFFSET returns #REF! or the wrong range
  8. Practise it

Keep reading

Lookups· 6 min read

INDEX Function in Excel: Return a Value by Position

The INDEX function returns the value at a given position in a range. Write =INDEX(array, row_num, [column_num]): =INDEX(B2:B6,3) returns the third value in B2:B6, and =INDEX(A2:D6,4,3) returns the value in the fourth row and third column. Positions count from the top-left of the range. Combine INDEX with MATCH to find the position automatically.

Lookups· 6 min read

INDEX MATCH in Excel: The Beginner's Guide

INDEX MATCH is a lookup built from two functions. MATCH finds the position of a value in one column, and INDEX returns the item at that position from another column: =INDEX(A2:A9,MATCH(G2,B2:B9,0)). It can look left, it keeps working when columns are inserted, and it runs in every version of Excel.

Math· 6 min read

How to Make a Running Total in Excel

To make a running total in Excel, type =SUM($B$2:B2) in the first row next to your numbers and fill it down. The dollar signs lock the start of the range at B2, while the end moves down one row at a time, so each row adds everything from the top to itself. The last row equals the grand total.

More on lookups

  • Return the Column Header for a Value in Excel
  • Tax Bracket and Tier Lookups in Excel
  • Two-Way Lookup in Excel (Row and Column)
  • VLOOKUP in Excel: Step-by-Step for Beginners
  • VLOOKUP From Another Workbook in Excel
  • VLOOKUP Approximate Match for Tiers and Bands
All lookups articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free