11.08.2013 Views

Excel's Formula - sisman

Excel's Formula - sisman

Excel's Formula - sisman

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 3: Working with Names 91<br />

The formula in Figure 3-18 uses two worksheet functions. The TODAY function returns the current<br />

date, and the MONTH function returns the month number of its date argument. Therefore, you<br />

can enter a formula such as the following into a cell and it will return the number of the current<br />

month. For example, if the current month is April, the formula returns 4.<br />

=ThisMonth<br />

A more useful named formula would return the actual month name as text. To do so, create a formula<br />

named MonthName, defined as<br />

=TEXT(TODAY(),”mmmm”)<br />

See Chapter 5 for more information about Excel’s TEXT function.<br />

Now enter the following formula into a cell and it will return the current month name as text. In<br />

the month of April, the formula returns the text April.<br />

=MonthName<br />

Using cell and range references in named formulas<br />

Figure 3-19 shows yet another example of creating a named formula, this time with a cell reference.<br />

This formula, named FirstChar, returns the first character of the contents of cell A1 on<br />

Sheet1. This formula uses the LEFT function, which returns characters from the left part of a text<br />

string. The named formula is<br />

=LEFT(Sheet1!$A$1,1)<br />

Figure 3-19: Defining a named formula that uses a cell reference.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!