SET.NAME() Cannot Define a Formula

Last reviewed: November 3, 1994
Article ID: Q69266
The information in this article applies to:
  • Microsoft Excel for Windows, versions 2.x, 3.0, 4.0, 4.0a, 5.0
  • Microsoft Excel for OS/2 version 2.2 and 3.0

SUMMARY

The DEFINE.NAME() function in Microsoft Excel allows you to define a name as an expression that can be evaluated, such as =3*27 or =COS(x).

If the SET.NAME function is used to define a name as such an expression, the name will be defined as the text of the expression, not the expression itself.

MORE INFORMATION

For example, the statement

   =DEFINE.NAME("func","=36+1")

defines the name "func" to be the expression:

   =36+1

If a later cell in the macro contains the statement

   =func

that cell will evaluate to the value 37.

However, the statement

   =SET.NAME("func","=36+1")

defines the name "func" to be the text "=36+1", and if a later cell contains the statement "=func", that cell will evaluate to the text value "=36+1", which has a numeric value of zero.

REFERENCES

"Function Reference," version 4.0, pages 100-101, 389-390 "Microsoft Excel Function Reference," version 3.00, pages 48-49, 217-218 "Microsoft Excel for Windows Functions and Macros," versions 2.1x, pages 266-267, 254-255


KBCategory: kbusage
KBSubcategory:

Additional reference words: 2.0 2.00 2.01 2.1 2.10 2.2 2.20 2.21 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 3, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.