The Excel OFFSET FunctionSearch this site:
Custom Search
The Excel OFFSET function returns range of cells that is a specified number of rows and columns from an initial supplied range. The user can specify the size of the returned cell range. The format of the function is: OFFSET( reference, rows, cols, [height], [width] )
where the arguments are as follows:
The height and width arguments are optional. If these are not supplied, then the returned range is the same height and width as the initial supplied cell range, (reference). Note that if the requested returned range goes off the edge of the spreadsheet, the function returns an error. Example 1The following spreadsheets shows several examples of the OFFSET function being used to reference different cell ranges. In each example, the initial supplied range is highlighted in green and the resulting range that is returned by the function is shown in red.
Note that in the above examples, the function returns a cell range. Therefore, if you attempt to display the result in a cell, you will get an error message (eg. the first example above returns the range D5:D10 - but if you typed "=D5:D10" into a cell you would get an error). The following Example shows a practical use of the OFFSET function, where the results of the function are used in a further function. Example 2The above examples all return cell ranges, but do not show you ways in which you might make practical use of the OFFSET function. This is addressed in the following spreadsheet, which uses the OFFSET function to return different cell ranges, depending on the weekday shown in the cell B1 and then uses the returned range in a further calculation :
In the above spreadsheet, the OFFSET function is used in cells B2 and B3, to reference the sales figures for the weekday selected in cell B1. In both cells, the function uses the same arguments.
|
|||||||||||||||||||||
|
|
|||||||||||||||||||||
Copyright © 2008-2010 ExcelFunctions.net |
|||||||||||||||||||||
