Microsoft KB Archive/69266

{|
 * width="100%"|

SET.NAME Cannot Define a Formula

 * }

-

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(&quot;func&quot;,&quot;=36+1&quot;)

defines the name &quot;func&quot; 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(&quot;func&quot;,&quot;=36+1&quot;)

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