7.1 Returning Date Information

advertisement
Chapter 7 - Date and Time Functions
CHAPTER 7 - DATE AND TIME FUNCTIONS
7.1
Returning Date Information
Returning Parts of a Date
The following functions return parts of a given date:
Wise
Owl’s
Hint
The WEEKDAY function has an optional second argument called the return type.
By default, Sunday is the first day of the week (hence why the Thursday above
shows up as 5), but if you set the return type to 2, for example, Monday will be the
first day of the week.
Returning today’s Date/Time
You can use the following functions to get today’s date and/or time:
Wise
Owl’s
Hint
© Copyright 2016
You can press Ctrl + ; (semi-colon) to put the current date into a cell, and Ctrl
+ : (colon) to put the current time in, but be aware that these are static values
which won’t subsequently update.
Page 40
Chapter 7 - Date and Time Functions
Returning Parts of a Time
The following functions get the hour, minute or second for a given date/time:
Converting Numbers/Text into Dates/Times
You can use the following date conversion functions:
Alternatively, use the following functions to convert to times:
© Copyright 2016
Page 41
Chapter 7 - Date and Time Functions
7.2
Manipulating Dates
Returning Different Dates
There are a host of useful functions which return one date, given another:
Wise
Owl’s
Hint
The WORKDAY function also allows you to specify a third argument containing a
range of bank holidays to be treated as non-working days. There is also a
WORKDAY.INTL function which allows you to customise what counts as a
weekend also.
Returning the Difference between Dates
Excel has a rich range of functions for taking the difference between two dates (of course, the
easiest method is just to subtract one date from another):
Wise
Owl’s
Hint
© Copyright 2016
The NETWORKDAYS function allows you to specify a 3rd argument to list out a
range containing bank holidays which should not be treated as working days, while
the NETWORKDAYS.INTL function allows you to customise what counts as a
weekend.
Page 42
Download