Related Topics: | ||
Description: Returns a reference to a range that is a specific number of rows and columns from a cell or range of cells.
Syntax: OFFSET(Reference, Rows, Columns, [Height], [Width])
Reference is the reference from which you want to base the offset. Reference must be a reference to a cell or range of adjacent cells.
Rows is the number of rows, up or down, that you want the upper-left cell to refer to. Using 5 as the Rows argument specifies that the upper-left cell in the reference is five rows below reference. Rows can be positive (which means below the starting reference) or negative (which means above the starting reference).
Columns is the number of columns, to the left or right, that you want the upper-left cell of the result to refer to. Using 5 as the Columns argument specifies that the upper-left cell in the reference is five columns to the right of reference. Columns can be positive (which means to the right of the starting reference) or negative (which means to the left of the starting reference).
Height is the height, in number of rows, that you want the returned reference to be. Height must be a positive number.
Width is the width, in number of columns, that you want the returned reference to be. Width must be a positive number.
Remarks:
If Rows and Columns offset Reference over the edge of the worksheet, OFFSET returns the #REF! error value.
If Height or Width is omitted, it is assumed to be the same height or width as Reference.
OFFSET doesn't actually move any cells or change the selection; it just returns a reference. OFFSET can be used with any function expecting a reference argument. For example, the formula SUM(OFFSET(C2, 1, 2, 3, 1)) calculates the total value of a 3-row by 1-column range that is 1 row below and 2 columns to the right of cell C2.
Example:
OFFSET(C3, 2, 3, 1, 1) = F5. If you enter this formula on a worksheet, the software displays the value contained in cell F5.
OFFSET(C3:E5, -1, 0, 3, 3) = C2:E4
OFFSET(C3:E5, 0, -3, 3, 3) = #REF!
© 1992-2015. ReliaSoft Corporation. ALL RIGHTS RESERVED.