Incrementing Relative References in Formulas by More Than OneLast reviewed: February 2, 1998Article ID: Q152265 |
The information in this article applies to:
SUMMARYWhen you fill formulas down a column or across a row, the relative references are, by default, incremented by one. The formulas can be altered so that they are incremented by a user-defined amount through the use of the OFFSET function.
MORE INFORMATIONThe formula for incrementing by more than a row is:
=OFFSET(<Starting_Cell>,(ROW()-<Current_Row>)*<Inc>,0)where <Starting_Cell> is the absolute reference to the first cell in the range of interest, <Current_Row> is the row of the cell in which the formula is being entered, and <Inc> is the number of rows to increment. The formula for incrementing by more than column is:
=OFFSET(<Starting_Cell>,0,(COLUMN()-<Current_Column>)*<Inc>)where <Starting_Cell> is the absolute reference to the first cell in the range of interest, <Current_Column> is the number associated with the column of the cell in which the formula is being entered, and <Inc> is the number of columns to increment.
Example Incrementing a Formula by More Than One Row
Example Incrementing a Formula by More Than One Column
Example Using ISEVEN FunctionThis formula is not restricted to extracting data. It can also be used within other formulas. By using the following formula, you can test if the numerical data in every fourth row is even:
=IF(ISEVEN(OFFSET(<Starting_Cell>,(ROW()-<Current_Row>)*<Inc>,0), "EVEN","ODD")where <Starting_Cell> is the absolute reference to the first cell in the range of interest, <Current_Row> is the row of the cell in which the formula is being entered, and <Inc> is the number of rows to increment. NOTE: This formula requires that the Analysis ToolPack is included in the Add-Ins. To do this, on the Tools menu, click Add-Ins and click to select the check in the box next to Analysis ToolPack.
ARTICLE-ID: Q151337 TITLE : Incrementing Relative References by More Than One Cell in VBA |
Additional query words: 5.00 5.00c 7.00 7.00a 5.00a 97 8.00 98 XL98 XL97
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |