Microsoft Office Tutorials and References
In Depth Information
Using YEAR, MONTH, DAY, HOUR, MINUTE, and SECOND to Break a Date/Time Apart
can be made to look alike, but you need to
choose the proper one if you are going to be using the result in a later cal-
Figure 11.37.
Figure 11.37. NOW
NOW and
and TODAY
TODAY can be made to look alike, but you need to
choose the proper one if you are going to be using the result in a later cal-
culation.
culation.
Row 8 calculates the number of days until a deadline approaches. Although
most people would say that tomorrow is one day away, the formula in A8
would tend to say that the deadline is 0.6969 days away. This can be deceiv-
ing. If you are going to use the result of NOW or TODAY in a date calculation,
you should use TODAY to prevent Excel from reporting fractional days. The
formula in A8 is =A7-A3, formatted as numeric instead of a date.
Using
Using YEAR
YEAR ,, MONTH
MONTH ,, DAY
DAY ,, HOUR
HOUR ,, MINUTE
MINUTE ,, and
and SECOND
SECOND tto Break
Break a Date/
Date/Time
Time
Apart
Apart
If you have a column of dates from the month of July 2015, you can easily
make them all look the same by using the MMM-YY format. However, the
dates in the actual cells are still different. The July 2015 records are not
sorted as if they were a tie. Excel offers six functions that you can use to
extract a single portion of the date: YEAR, MONTH, DAY, HOUR, MINUTE, and
SECOND.
In Figure 11.38 , cell A1 contains a date and time. Functions in A3 through A8
break out the date into components:
=YEAR(date) returns the year portion as a four-digit year.
=MONTH(date) returns the month number, from 1 through 12.
Search JabSto ::

Custom Search