Excel function

OFFSETfunction

Points to the cell (or range) a given number of rows and columns away from a reference cell.

All versions
=OFFSET(A1, 4, 2)
A
B
C
D
1
2
3
4
5
6
7
8
9

Click a cell in the table to change reference. Click the sheet to change the reference cell. Enter 3 for height to get a range. Enter -5 for rows to go off the sheet and get #REF!. Try breaking it on purpose to see the errors.

Result

6900

reference
A1You can also click a cell in the table

The starting cell. Click it in the sheet.

rows

How many rows to move down. Negative moves up.

cols

How many columns to move right. Negative moves left.

height

The number of rows in the returned range. Omitted means 1.

width

The number of columns in the returned range. Omitted means 1.

What is the OFFSET function?

=OFFSET(reference, rows, cols, [height], [width])

OFFSET returns the cell or range that is a given number of rows down and columns to the right of a reference cell.

Give a height and width and it becomes a range of that size, which you can use as a moving range inside SUM or AVERAGE. Watch the move on the sheet above.

Arguments

reference
The starting cell or range.
rows
How many rows to move down. Negative moves up.
cols
How many columns to move right. Negative moves left.
height
The number of rows in the returned range. Omitted means the same as reference.
width
The number of columns in the returned range. Omitted means the same as reference.

OFFSET examples

  1. Example 1. A single cell

    =OFFSET(A1, 4, 2)

    Moving 4 down and 2 right reaches C5, whose value is 6900.

  2. Example 2. Sum a range

    =SUM(OFFSET(C1, 1, 0, 3, 1))

    The sum of C2:C4, 7000.

  3. Example 3. Average of the last 3

    =AVERAGE(OFFSET(C1, COUNT(C:C)-2, 0, 3))

    Averages the last 3 values even as data grows.

Common mistakes

FAQ

What if it goes off the sheet?
You get #REF!.
What if height is negative?
The range extends upward.