Excel: OFFSET Returns a Reference, Not an Action Command

Last reviewed: November 30, 1994
Article ID: Q59621
The information in this article applies to:
  • Microsoft Excel for Windows, versions 2.x, 3.0, and 4.0
  • Microsoft Excel for the Macintosh, versions 1.x, 2.x, 3.0, and 4.0

Summary:

In Microsoft Excel, the OFFSET macro function returns a reference based on the entered arguments and does not actually perform an action, such as selecting a group of cells. It can, however, be used as an argument in a macro function that does perform a particular action. For example

   =OFFSET(SELECTION(),1,1)

returns the active external reference (returned by the SELECTION function) shifted by one row and one column. Therefore, if the macro was run with the above statement and the active selection was "A1:C2", the formula would return the reference of "B2:D3".

To actually select the offset of a group of cells, use the OFFSET function as the reference argument in the SELECT function. On a worksheet or macro sheet, using the above example

   =SELECT(OFFSET(SELECTION(),1,1))

selects the active group of cells, shifted down by one row and over to the right by one column.

For more information about OFFSET in Microsoft Excel 4.0, see pages 299-300 in the "Microsoft Excel Function Reference." If you are using Microsoft Excel 3.0, see pages 163-164 in the "Microsoft Excel Function Reference" version 3.0. If you are using Microsoft Excel 2.20, see pages 251-252 in the "Microsoft Excel Functions and Macros" version 2.2.

For more information about SELECT and SELECTION in Microsoft Excel 4.0, see pages 378-381 and 383-384 respectively. If you are using version 3.0, see pages 209-212 and 214, respectively, in the "Microsoft Excel Function Reference," version 3.0. If you are using version 2.2, see pages 274-275 and 278, respectively, in the "Microsoft Excel Functions and Macros," version 2.2.


KBCategory: kbusage
KBSubcategory:

Additional reference words: 1.0 1.00 1.03 1.04 1.06 1.5 1.50 2.2 2.20 3.0
3.00 4.0 4.00


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 30, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.