Open In App

OFFSET Function in Excel With Examples

Excel contains many useful formulas and functions that make it more and more useful and at the same time user-friendly. Such a function is the OFFSET() function. In many cases, this function is also used inside another function. This function basically returns a reference of a single cell or a range of cells depending on the input. With the help of this function, we can traverse from one cell to another cell. Moreover, the user can specify the number of rows and columns to be returned.

This function is a volatile function that also works according to its name. It returns a reference of the desired element(s) that is(are) ‘offset’ of some distance from the given starting point. This can be used within some functions to make tasks easier. 



Syntax:

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

-->Here the [height] and [width] are optional.

This function takes a valid reference, rows, and columns(To know how much distance the function will traverse), and height and width(that describes the height and width of output reference) as its arguments and returns the desired reference of the cell or the range of cells. These arguments are discussed below elaborately.



Arguments:

Note: The number of rows and columns must not exceed the height and width of the worksheet.

Return Value: This function naturally returns a reference to a range of cells(sometimes a single cell depending on the input arguments) of a certain height and width either same as the ‘reference’ argument or as the user has provided. 

Example:

An Excel sheet has been taken as an example and the OFFSET function has been used in several formats.

Value 1 Value 2 Value 3
25 5 5
35 7 5
23 0 0
26 25 5
28 3 6

OFFSET function has been applied to the above table.

OFFSET() function  Results Remarks
=OFFSET(C4, 2, -2, 1, 1) 28

OFFSET function traverses 2 rows down and 2 columns left, 

and returns the reference of cell A6.

=OFFSET(C2, 5, -5) #REF! Rows and columns arguments exceed the height and width of the worksheet. So it shows the error(#REF!).
=SUM(OFFSET(B2:C5, 0, -1)) 146 Here OFFSET is used within the SUM() function. It returns the sum of all elements from A2 to B5 as OFFSET returns the reference of A2:B5 cells.

Output:

Article Tags :