11.08.2013 Views

Excel's Formula - sisman

Excel's Formula - sisman

Excel's Formula - sisman

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 6: Working with Dates and Times 153<br />

You can also display the date, combined with text. The formula that follows, for example, displays<br />

text such as Today is Friday, April 9, 2010:<br />

=”Today is “&TEXT(TODAY(),”dddd, mmmm d, yyyy”)<br />

It’s important to understand that the TODAY function is updated whenever the worksheet is calculated.<br />

For example, if you enter either of the preceding formulas into a worksheet, the formula<br />

displays the current date. When you open the workbook tomorrow, though, it will display the<br />

current date for that day (not the date when you entered the formula).<br />

To enter a date stamp into a cell, press Ctrl+; (semicolon). This enters the date directly<br />

into the cell and does not use a formula. Therefore, the date does not change.<br />

Displaying any date<br />

As explained earlier in this chapter, you can easily enter a date into a cell by simply typing it,<br />

using any of the date formats that Excel recognizes. You can also create a date by using the<br />

DATE function, which takes three arguments: the year, the month, and the day. The following formula,<br />

for example, returns a date comprising the year in cell A1, the month in cell B1, and the day<br />

in cell C1:<br />

=DATE(A1,B1,C1)<br />

The DATE function accepts invalid arguments and adjusts the result accordingly. For<br />

example, this next formula uses 13 as the month argument, and returns January 1, 2010.<br />

The month argument is automatically translated as month 1 of the following year.<br />

=DATE(2009,13,1)<br />

Often, you’ll use the DATE function with other functions as arguments. For example, the formula<br />

that follows uses the YEAR and TODAY functions to return the date for Independence Day (July<br />

4th) of the current year:<br />

=DATE(YEAR(TODAY()),7,4)<br />

The DATEVALUE function converts a text string that looks like a date into a date serial number.<br />

The following formula returns 40412, the date serial number for August 22, 2010:<br />

=DATEVALUE(“8/22/2010”)

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

Saved successfully!

Ooh no, something went wrong!