0% found this document useful (0 votes)
712 views

Excel Date and Time

This document provides information about working with dates and times in Excel, including: 1) Formatting dates and times, entering them correctly, and changing the display format. 2) Performing calculations with dates and times, such as calculating the number of days between two dates or the time difference between two times. 3) Using date functions in Excel, such as NOW(), TODAY(), WEEKDAY(), NETWORKDAYS(), and DATEDIF() to retrieve additional date-related information.

Uploaded by

skondra12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
712 views

Excel Date and Time

This document provides information about working with dates and times in Excel, including: 1) Formatting dates and times, entering them correctly, and changing the display format. 2) Performing calculations with dates and times, such as calculating the number of days between two dates or the time difference between two times. 3) Using date functions in Excel, such as NOW(), TODAY(), WEEKDAY(), NETWORKDAYS(), and DATEDIF() to retrieve additional date-related information.

Uploaded by

skondra12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Table of Contents

Working with date and time 1

DESCRIPTION 1

FORMAT TO ENTER DATES OR TIME VALUES 1

TIPS 2

CHANGING THE FORMAT OF A DATE 2

CREATING A CUSTOM FORMAT 3


Performing calculation with date and time values 5

DESCRIPTION 5

CREATE A FORMULA 5

ADDING NEGATIVE HOURS 6


Date functions 8

DESCRIPTION 8

PRACTICAL USE 8

=NOW () - =TODAY() 8

=WEEKDAY() 9

ADDITIONAL FUNCTIONS 11

=NETWORKDAYS() 11

=DATEDIF() 12

Excel XP : Date & Time


Working with date and time

Working with date and time

At the end of this chapter, you will be able to:


ƒ Use date and time in a correct format
ƒ Change the way date or time values are displayed.

DESCRIPTION
Excel stores all dates as serial numbers and times as decimal fractions, enabling
them to be added, substracted, and included in other calculations.

FORMAT TO ENTER DATES OR TIME VALUES


Date

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

Hours, minutes and seconds should be separated with a colon":".


Example : 8:57:00

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

CTRL + ; Insert the current date in the active cell

CTRL + : Insert the current time in the active cell

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.

CHANGING THE FORMAT OF A DATE


After entering a date or a time value, you can edit the way it is displayed.

ª Highlight the cells whose format you want to change.


ª Right-click in your selection.

Excel XP : Date & Time

ª Choose FORMAT - CELLS.


The dialog box contains multiple tabs.
Date and time format lets you customize the way those values are displayed. For
example, you could have the Month displayed in plain letters.

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.

CREATING A CUSTOM FORMAT


Date

If none of the available formats within the DATE & TIME Category suits your need,
you can create your own format.

ª Enter a date in a valid format.


Example : 31/03/04

ª Highlight the cell(s) containing the date(s) you have entered.


ª Choose FORMAT – CELLS.
ª Select the CUSTOM category.
ª To create a format that would show the day of the week and the month in
letters, you should use the following custom format:

ª Type in the following format JJJJ JJ MMMM AAAA.


ª The date will be shown as WEDNESDAY 31 MARCH 2004.
Time

ª Enter the date as explained before.


Example : 14:44:00

ª Select the cell(s) containing the time value(s).


ª Choose FORMAT – CELLS.
Excel XP : Date & Time
ª Select the CUSTOM category.
ª To create a Time format that would show morning or afternoon, select the
following custom format H:MM AM/PM.

ª Time will be displayed as followed 2:45 PM.

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 "-".

Excel XP : Date & Time

4
Performing calculation with date and time values

Performing calculation with date and time values

At the end of this chapter you will be able to:


ƒ Perform calculation on date or time values entered in an Excel
spreadsheet.

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.

ª Type in the "=" sign.


ª Select the date or the end time value.
ª Enter the arithmetic operator.
ª Select the cell containing the second date or the start time value.
ª Validate your formula.
Examples:
STARTING ENDING TIME
TIME TIME LAPSE

8:30:50 17:05:50 8:35:00 Excel XP : Date & Time

9:09:00 17:00:00 7:51:00

9:30:00 17:00:00 7:30:00

8:50:10 17:23:50 8:33:40

8:00:50 17:05:50 9:05:00

5
Performing calculation with date and time values

Birth date Today's date Number of days


23/10/1956 31/03/2004 17326
21/12/1953 31/03/2004 18363
1/04/1951 31/03/2004 19358
22/11/1948 31/03/2004 20218
2/01/1980 31/03/2004 8855

ADDING NEGATIVE HOURS


If for any reason you need to perform calculation on time values and the result is a
negative time value, Excel will not be able to display it (the number sign "#" will be
showing instead of the actual result!

Example :
Extra Time
0:05:00
####################
####################
0:03:40
0:35:00
0:21:00
1:00:00
2:03:40

But if you perform calculation on that result it will be correct!

Modify the display for negative time values

ª Click on the TOOLS menu.


ª Select OPTIONS.
ª Click on the CALCULATION tab
ª Activate the checkbox.

Excel XP : Date & Time


ª Negative time values will then be showing correctly.
Extra Time
0:05:00
-0:39:00
-1:00:00
0:03:40
0:35:00
0:21:00

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.

Excel XP : Date & Time

7
Date functions

Date functions

At the end of this chapter you will be able to:


ƒ Use efficiently some of the Excel predefined date and time
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

ª Entering the "=" symbol.


ª Typing the function's name.
Excel XP : Date & Time
ª Open and close brackets.
ª Validate the function by hitting ENTER .
Or

ª Click on the triangle showing next to the Autosum function button .

8
Date functions

ª A dropdown list will be displayed.

ª Select the MORE FUNCTIONS…option.


ª Choose the DATE & TIME category.
ª In the list, select either the NOW or the TODAY function.

=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.

ª Click on the triangle next to the Autosum function button .

ª The following dropdown list will be displayed.

Excel XP : Date & Time


ª Select MORE FUNCTIONS…
ª Choose the DATE & TIME category
ª In the following list, select the WEEKDAY function.

9
Date functions

ª Click on .

ª Select the address of the cell you want to apply the function to.

Excel XP : Date & Time


ª The second argument is used to change the number corresponding to the
different days.

ª By default, Sunday will be represented by the value "1".


If you want to use Monday as the number 1 value, just enter a "2" in the
RETURN_TYPE area.
By entering the number "3" in that area, the value for Monday would be "0".

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).

ª Click on TOOLS from the main menu.


ª Choose the ADD-INS option.
ª Select the ANALYSIS TOOLPAK checkbox from the dialog box.

ª Confirm you choice by hitting .

=NETWORKDAYS()
This function will allow you to compute the exact number of working days between
two dates.

Excel XP : Date & Time

ª Click on the triangle next to the Autosum function button .

11
Date functions

ª The following dropdown list will be displayed.

ª Select MORE FUNCTIONS…


ª Choose the DATE & TIME category
ª In the following list select the NETWORKDAYS function.
ª In the following dialog box you will have to define the "Start Date" as the first
argument and the "End Date" as the second argument

ª The third argument is optional. It allows you to specify the legal holidays that
should be deduct from the result.

=DATEDIF() Excel XP : Date & Time


This Excel undocumented function allows you to compute easily an exact number
of year or months between two dates.
=DATEDIF(beginning_date,ending_date,unit_of_measure).
What makes DATEDIF useful is the third argument: the unit of measure. That
argument tells Excel what calculation you want based on the dates you supply. The
options for the unit argument are Y, M, D, MD, YM, and YD.
Here is what they return:

12
Date functions

ƒ Y: Complete years in between the dates specified


ƒ M: Complete months in between the dates specified
ƒ D: Complete days in between the dates specified
ƒ MD: Number of days between the first and second dates, without regard to
month or year
ƒ YM: Number of months between the dates, without regard to day or year
ƒ YD: Number of days between the dates, without regard to the year
For instance, the expression =DATEDIF("2002/09/01","2002/10/01","D") returns 30,
but the expression =DATEDIF("2002/09/01","2002/10/01","MD") returns 0 because
the argument MD tells Excel to subtract the second date from the first date, without
regard to month or year. The expression
=DATEDIF("2002/09/01","2002/10/01","Y") also returns 0; this is because the two
dates do not span at least one complete year.
Examples :
Date de début Date de fin Résultat Fonction utilisée
23/10/1956 1/04/2004 47 =(DATEDIF(A1;B1;"Y"))
23/10/1956 1/04/2004 569 =(DATEDIF(A1;B1;"M"))
23/10/1956 1/04/2004 17327 =(DATEDIF(A1;B1;"D"))
23/10/1956 1/04/2004 9 =(DATEDIF(A1;B1;"MD"))
23/10/1956 1/04/2004 5 =(DATEDIF(A1;B1;"YM"))
23/10/1956 1/04/2004 160 =(DATEDIF(A1;B1;"YD"))

Exercise 3.
ƒ Find out the number of years, months and days you
have been working for your company.

Excel XP : Date & Time

13

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy