OFFSET Function in Excel With Examples
Last Updated :
27 May, 2021
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:
- reference (Required): This is the reference of the starting point or the base of the OFFSET() function and this reference must be provided by the user. The reference must be valid i.e. a reference of a single cell or a reference to a range of adjacent cells.
- rows (Required): This argument contains the number of rows(up or down) that are used by the OFFSET() function to traverse up or down. Again this argument must be provided by the user. This value may be negative or positive. A negative value denotes that the function has to traverse upwards and a positive value denotes traversing downwards.
- cols (Required): This argument contains the number of columns provided by the user. With the help of this argument OFFSET(), function traverse left or right of the starting point. This value may also be negative or positive. A negative value means traversing to the left and a positive value means traversing to the right.
- [height] (Optional): This is the height of the reference to be returned by the OFFSET() function. Basically, this value denotes the number of rows of the returned reference. This value must be a positive number. But this is an optional argument. If this argument is omitted, OFFSET() returns a reference of the same height as the 'reference'(starting point).
- [width] (Optional): This is the width of the reference to be returned by the OFFSET() function. Basically, this value denotes the number of columns of the returned reference. This value must also be a positive number. But again this is an optional argument. If this argument is omitted, OFFSET() returns a reference of the same width as the 'reference'(starting point).
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:
Similar Reads
Statistical Functions in Excel With Examples To begin with, statistical function in Excel let's first understand what is statistics and why we need it? So, statistics is a branch of sciences that can give a property to a sample. It deals with collecting, organizing, analyzing, and presenting the data. One of the great mathematicians Karl Pears
6 min read
How To Use MATCH Function in Excel (With Examples) Finding the right data in large spreadsheets can often feel like searching for a needle in a haystack. This is where the MATCH function in Excel proves invaluable. The MATCH function helps you locate the position of a specific value within a row or column, making it a cornerstone of efficient data m
6 min read
Excel ROWS and COLUMNS Functions with Examples In Microsoft Excel, where precision and efficiency reign supreme, mastering the art of maneuvering through cells and worksheets is indispensable. Two indispensable components in your Excel toolbox are the ROW and COLUMN functions, each meticulously crafted to execute discrete functions that can subs
7 min read
How to Use Goal Seek in Excel with Examples: A Complete Guide Excel Function Goal Seek : Quick StepsSet Up Your DataGo to Data Tab>>Select What-if-AnalysisFill Out the Goal Seek Dialog BoxRun Goal Seek>>Review the ResultsDo you find yourself stuck trying to solve âwhat-ifâ scenarios in Excel? Whether itâs calculating loan payments, determining sale
9 min read
How to Use HLOOKUP in Excel (Formula & Examples) Excel HLOOKUP Function - Quick StepsSelect the cell Enter the HLOOKUP formulaInput arguments>>Press Enter Excel is packed with features that make handling and analyzing data easier. One of these handy tools is the HLOOKUP function, which is great for finding information in tables that are orga
9 min read
How to use Copilot in Excel with Examples (Step-by-Step Guide) As of 2024, Microsoft introduced a new feature called Copilot for Excel, part of the broader Microsoft 365 suite, designed to enhance productivity and streamline data manipulation using AI-powered tools. The introduction of Excel Copilot is transforming how professionals across industries manage and
9 min read
7 Uses of Excel in Business with Real World Examples Ever wondered how businesses turn raw data into actionable strategies or manage complex budgets with precision? The answer often lies in a tool you might already have: Microsoft Excel. From tracking sales trends to forecasting expenses, Excel remains a cornerstone of business Excel tools, offering u
6 min read
How to Create a Data Entry Form in Excel With Examples How to Make Data Entry Form in ExcelStep 1: Select Any Cell in Your Dataset > Press the Ctrl+T keys together to Convert it to a table. Step 2: Now Click on the Form Button in the Ribbon Step 3: Pressing the Form button generates a data entry form for your table, featuring fields corresponding to
9 min read
Importance of Microsoft Excel in the Workplace (With Real-World Examples) What if one tool could help you organize data, create budgets, track projects, and even build dashboardsâall in one place? Thatâs the power of Microsoft Excel. From small businesses to Fortune 500 companies, Excel has become a cornerstone of workplace productivity. But why is it so widely used, and
7 min read