Functions in Names

Using Excel functions in names can extend a simple naming facility and offer possibilities for specifying arguments in these functions. In Chapter 2, you learned about the different syntaxes for references. In addition to basic relative, mixed, and absolute cell references, the use of names for functions provides further possibilities.

A name can be used for a:

  • Reference

  • Constant

  • Formula

Querying Current Information

You can use an information function (see Chapter 10) to query the path, file name, and sheet name of the currently saved workbook. The workbook must be saved, otherwise an empty string (“”) will be returned. The formula is:

=CELL("filename")

but the function returns all the information in a single string; for example:

C:\Excel-Functions\Chapter05\[Chapter05_Names.xls]Fct_Names ...

Get Microsoft® Excel® 2010 Formulas & Functions Inside Out now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.