|
Whether you are a
mature Excel user who wants to explore the
application’s powerful decision making tools or
an Excel novice wishing to improve productivity
in daily numerical and presentation tasks,
“Excel Tips” is here to give you the answers you
need. Written by professionals who use Excel for
taking decisions, planning resources, automating
routine number – crunching work or just
preparing reports in a presentable fashion.
Question:
How are dates dealt with in Excel? How easily
can one subtract between dates to find the
number of calendar days or working dates?
Excel Tip:
Excel follows a simple numerical approach to
dates: It considers 1/1/1900 as being equivalent
to number 1 and counts serially all subsequent
dates, taking into account, of course, leap
years etc. If, for instance, you type 15/1/1900
and give the entry a non-date numerical format
(e.g. by clicking the comma style on the
formatting toolbar), you will see that Excel
gives the number 15. When, therefore, you ask
Excel to subtract one date from another, it
simply subtracts one integer from another and
gives the result. You then change the formatting
of the result from a date to a number.
If you want to have the number of working
days rather than calendar ones between two
dates, you will need the NETWORKDAYS function.
This is offered when you choose the Tools –
Add-Ins… command and then select the
Analysis ToolPak box. The function is based
on a 5-day working week.
In the following example, we calculate
the number of working days between the 20th
of December 2006 and the 20th of
January 2007 (cells E14 and E15 respectively),
taking into account the 3 holidays falling in
this date-bracket (which we
enter in
cells G14:G16). The function in cell E17 is
NETWORKDAYS(E14;E15;G14:G16):
| |
E |
F |
G |
|
14 |
20/12/2006 |
|
25/12/2006 |
|
15 |
20/01/2007 |
|
26/12/2006 |
|
16 |
|
|
01/01/2007 |
|
17 |
|
|
|
If
you want to disregard the holidays, you just
omit the range G14:G16 from the function. |