Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

How to Use the OFFSET Function in Excel

Learn how to use OFFSET Function in Excel, including its purpose, syntax, examples, and common errors, with clear step-by-step guidance.

Table of Contents

This guide explains how to use OFFSET Function in Excel, including its syntax, required arguments, practical examples, and common errors.

How to Use the OFFSET Function in Excel screenshot

Description

The Offset function returns a reference to a range a number of rows and a range of cells a specified number of rows and columns. This means that the Offset function returns a reference to a range, based on the position of the cell or the range of cells you specify as a landmark, and moves according to the number of rows and columns you specify.

The reference that the Offset function returns can be a single cell or a range of cells where you specify the number of rows and columns to return.

Syntax

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

Inside:

  • reference is the required argument, is the reference area that you want this to be the starting point (as a landmark) and then based on other arguments to move to the reference reference.
  • rows is a required argument, is the number of rows you want to move up or down the reference . If rows are positive, the function will move below the reference , if rows are negative then move up to the reference.
  • cols is a required argument, is the number of columns you want to move left or right reference after the function has moved in rows. If cols is positive, the function will move to the right number of cells equal to the number of cols , if the number of cols is negative, the function will move to the left of the cell number by the number of cols .
  • height is an optional argument, this is the height calculated by the number of rows you want for the reference to return.
  • width is an optional argument, this is the width calculated by the number of columns you want for the reference to return.

Note

  • If the rows and cols arguments cause the returned reference area to go beyond the sheet border, the function will return the #REF error value.
  • If height and width are omitted in the OFFSET function, the default return reference has the same height and width as the reference region.
  • If height and width > 1 means that the function must return more than 1 cell, you must use the array formula OFFSET function otherwise it will get #VALUE!
  • The height and width arguments must be positive.
  • The OFFSET function does not actually move any cells or change the selection, it only returns a reference.

For example

1. Returns the reference of 1 cell starting from D8, moving down 3 rows to the right by 2 columns.

Use the following formula: = OFFSET (D8; 3; 2)

For example screenshot 2

2. Returns the reference of 2 cells C10: C11 starts from cell D8, moves down 2 rows, to the left by 1 column.

If you just write the OFFSET formula formula = OFFSET (D8; 2; -1; 2; 1) , the function will return the #VALUE! Error. Because this example returns the reference of 2 cells, you need to apply the array formula.

For example screenshot 3

Since the reference returned as 2 cells C10: C11 should you choose any two adjacent cells in a column, then enter the function = OFFSET (D8; 2; 1; 2; 1) entering these you press the Ctrl + Shift + Enter to convert to an array formula. You will get the following result:

For example screenshot 4

4. Use the OFFSET function in combination with the SUM function to sum the returned range.

If you return a reference with multiple cells, you need to write the array formula as in the above example, but if combined with the SUM function, you do not need to use array formulas anymore. You enter the function = SUM (OFFSET (D8; 2; -1; 2; 1))

For example screenshot 5

4. Apply a specific example using the SUM function in combination with OFFSET

When the data is always changing, the OFFSET application is very useful instead of changing the SUM formula every time.

Suppose you have data as shown below.

For example screenshot 6

Every day you have new data, so you have to add new rows to the data table.

For example screenshot 7

You don't want to have to change the SUM formula every time you add data. Please apply the OFFSET function to automatically change when adding new data. In the sum cell you use the formula

= SUM (D7: OFFSET (D14; -1; 0))

The SUM function sums from the first cell in the Revenue column that is cell D7 to the returned reference of the OFFSET function. The OFFSET function returns the reference that is the position in the Total revenue row 1 row, which is the D13 position as shown.

For example screenshot 8

Thus, when you add new rows or delete rows in a data table, the OFFSET formula will update the corresponding position directly above the Total sales cell, and the SUM function will calculate the total more flexibly.

For example screenshot 9

Above the article has introduced to you the syntax, usage and examples of Excel OFFSET function. Hopefully, you will have a better understanding of how to use the OFFSET function and how to apply the OFFSET function to specific cases. Good luck!

FAQ

What does the OFFSET function do in Excel?

The OFFSET function performs the calculation described in this guide. Use the correct arguments and compatible data types for reliable results.

How do I enter the OFFSET function correctly?

Start with an equals sign, enter OFFSET, add the required arguments inside parentheses, and confirm that cell references and separators are correct.

Why does the OFFSET function return an error?

Common causes include missing arguments, invalid data types, incorrect cell references, unsupported values, or regional separator settings.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.