Excel Date and Time
Excel Date and Time
DESCRIPTION 1
TIPS 2
DESCRIPTION 5
CREATE A FORMULA 5
DESCRIPTION 8
PRACTICAL USE 8
=NOW () - =TODAY() 8
=WEEKDAY() 9
ADDITIONAL FUNCTIONS 11
=NETWORKDAYS() 11
=DATEDIF() 12
DESCRIPTION
Excel stores all dates as serial numbers and times as decimal fractions, enabling
them to be added, substracted, and included in other calculations.
If you want to enter a date (and your Windows environment has been defined for
Belgium), you must first type the day then the month and finally the year.
You can just enter the last two digits for the year except if you want to refer to a
date before January 1, 1930. (If you just type 10/10/29 for example, Excel will
automatically refer to October 10, 2029)
Day, Month and Year should be entered using the "/" as a separator.
Example : 31/03/04
Time
Remark :
If dates are entered in a valid format, they should be automatically
aligned on the right inside of the cell (like any number).
Excel XP : Date & Time
1
Working with date and time
TIPS
SHORTCUT FUNCTION
Remark :
If Excel does not recognize automatically a date (because of a incorrect
data importation for example), you can transform the content of the cell
by multiplying its value by 1.
You will the have to apply a "Paste Special VALUE" to transform the
result into a valid date.
2
Working with date and time
The format is not affecting the content of a cell. It is only another way of displaying
it on your screen
Choose the NUMBER tab in the FORMAT CELLS dialog box.
If you have selected a valid date, the DATE category should be automatically
selected.
You can also create your own formats by selecting the CUSTOM option in the
available categories.
If none of the available formats within the DATE & TIME Category suits your need,
you can create your own format.
3
Working with date and time
Exercise 1.
Create a custom format that will display the date with
Days in two figures, Months in letters and the Year in
two figures.
Change the format to separate each element with a
dash "-".
4
Performing calculation with date and time values
DESCRIPTION
Excel gives you the possibility to perform calculation with dates.
If you have a start date and an end date, you can easily compute the number of
days between those two dates.
After entering two time values, you can easily compute the time lapse between
those two values.
You can use those dates in calculation, because when you entered a date in an
Excel spreadsheet, it is stored as a value. January 1, 1900 is the number 1,
January 2, 1900 the number 2 and so on…
CREATE A FORMULA
ª Like for any formula you input in Excel, position first the cursor in the cell where
you want to result to be displayed.
5
Performing calculation with date and time values
Example :
Extra Time
0:05:00
####################
####################
0:03:40
0:35:00
0:21:00
1:00:00
2:03:40
6
Performing calculation with date and time values
Remark :
This option is only valid for the current file.
It will change the starting date in Excel date calculation.
The default date (number 1) will be shifted from January 1, 1900 to
January 1, 1904.
Exercise 2.
Compute the number of hours and minutes that you
have been at the office last week.
7
Date functions
Date functions
DESCRIPTION
Excel functions are grouped by categories.
If you are using dates or time values within a worksheet you may want to use some
of those predefined functions that are listed in the DATE & TIME category.
PRACTICAL USE
You may have to use DATE & TIME functions for multiple reasons:
Display today's date in a workbook;
Find out the day of the week corresponding to a specific date;
Isolate the month value corresponding to a specific date;
Convert a date from a text format to a valid number.
=NOW () - =TODAY()
Those two functions allow you to display the current date and/or time in a cell
The first one will show the date as well as the current time and the second will just
show the current date.
=NOW() 31/03/2004 16:12
=TODAY() 31/03/2004
Both function DATE & TIME do not have arguments but need to be followed by a
couple of empty brackets.
You can enter them in a cell by
8
Date functions
=WEEKDAY()
It is sometimes necessary to test a date to find out if the actual day of the week.
That would let you, for example, determine and apply another hourly rate if the
date corresponds to a Saturday or a Sunday.
9
Date functions
ª Click on .
ª Select the address of the cell you want to apply the function to.
10
Date functions
ADDITIONAL FUNCTIONS
By default, all functions are not showing in the list of functions. You can find and
add other functions (like, for example, the NETWOKDAYS function).
=NETWORKDAYS()
This function will allow you to compute the exact number of working days between
two dates.
11
Date functions
ª The third argument is optional. It allows you to specify the legal holidays that
should be deduct from the result.
12
Date functions
Exercise 3.
Find out the number of years, months and days you
have been working for your company.
13