Spreadsheet Date & Time Functions

3,442 views 40 slides Sep 26, 2019
Slide 1
Slide 1 of 40
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40

About This Presentation

The important date and time functions in spreadsheet for the Cambridge AS & A Level Program


Slide Content

Date and time functions
Cambridge AS level
Satree Phuket School - IPC

Today’s date
1. To enter today's date in Excel, use the TODAY function.
2

Today’s date
2. To enter the current date and time, use the NOW function.
3

Today’s date
3. To enter the current time only, use NOW()-TODAY() and
apply a time format.
4

Static Date & Time
1. To enter the current date as a static value, press CTRL + ;
(semicolon).
5

Static Date & Time
2. To enter the current time as a static value, press CTRL +
SHIFT + ; (semicolon).
6

Static Date & Time
3. To enter the current date and time as a static value, simply
press CTRL + ; (semicolon), enter a space and press CTRL +
SHIFT + ; (semicolon).
7

Date Difference
1. Fill in "d" for the third argument to get the number of days
between two dates.
Note: =A2-A1 produces the exact same result!
8

Date Difference
2. Fill in "m" for the third argument to get the number of months between two
dates.

9

Date Difference
3. Fill in "y" for the third argument to get the number of years between two dates.

10

Date Difference
4. Fill in "yd" for the third argument to ignore years and get the number of days
between two dates.

11

Date Difference
5. Fill in "md" for the third argument to ignore months and get the number of days
between two dates.

12

Date Difference
6. Fill in "ym" for the third argument to ignore years and get the number of
months between two dates.

13

Date Difference
Important note: the DATEDIF function returns the number of complete days, months or years. This may
give unexpected results when the day/month number of the second date is lower than the day/month
number of the first date. See the example below.

14

Time Difference
1. Simply subtract the start time from the end time.
15

Time Difference
2. Change the number format of the values in cell A2, B2
and C2 to General.
16

Time Difference Formula
The simple formula shown above doesn't work if the start
time is before midnight and the end time is after midnight.
1. Times that are negative show as ######.

17

Time Difference Formula
2. To clearly see this, change the number format of the
values in cell A2, B2 and C2 to General.

18

Time Difference Formula
3. The time difference formula below always works.
Explanation: if the end time is greater than or equal to the start time, simply
subtract the start time from the end time. If not, add 1 (full day) to the end time
to represent a time on the next day and subtract the start time.

19

Time Difference in Hours as Decimal Value
To calculate the difference between two times in hours as a decimal
value, multiply the previous formula by 24 and change the number
format to General.1. The formula below does the trick.

20

Calculate Age
To calculate the age of a person in Excel, use the DATEDIF function and the
TODAY function. The DATEDIF function has three arguments.
1. Enter the date of birth into cell A2.

21

Calculate Age
2. Enter the TODAY function into cell B2 to return today's
date.

22

Calculate Age
3. The DATEDIF function below calculates the age of a person.
Note: fill in "y" for the third argument to get the number of complete years
between the date of birth and today's date.

23

Calculate Age
4. Calculate the age of a person without displaying today's date.



24

Calculate Age
5. Calculate the age of a person on a specific date.
Note: the DATE function accepts three arguments: year, month and day.



25

Calculate Age
6. Calculate the age of a person in years, months and days.
Note: fill in "ym" for the third argument to ignore years and get the number of
months between two dates. Fill in "md" for the third argument to ignore
months and get the number of days between two dates. Use the & operator to
concatenate strings.



26

WeekDay Function
1. The WEEKDAY function in Excel returns a number from 1 (Sunday) to 7
(Saturday) representing the day of the week of a date. Apparently, 12/18/2017
falls on a Monday.
27

Week Days
2. You can also use the TEXT function to display the day of the week.
28

Week Days
3. Or create a custom date format (dddd) to display the day of the week.
29

Networkdays function
1. The NETWORKDAYS function returns the number of weekdays (weekends
excluded) between two dates.
30

Networkdays function
2. If you supply a list of holidays, the NETWORKDAYS function returns the
number of workdays (weekends and holidays excluded) between two dates.
The calendar helps you understand the NETWORKDAYS function.
31

Workday function
The WORKDAY function is (almost) the opposite of the NETWORKDAYS
function. It returns the date before or after a specified number of weekdays
(weekends excluded).
The calendar helps you understand the WORKDAY function.
32

Days Until Birthday
1. Enter the date of birth into cell A2.
33

Days Until Birthday
2. Enter the TODAY function into cell B2 to return today's date.
34

Days Until Birthday
3. The most difficult part in order to get the number of days until your birthday
is to find your next birthday. The formula below does the trick.
35

Days Until Birthday
4. Next, we use the DATEDIF function to find the number of days ("d") between
Today and Next Birthday.


36

Time Sheet
1. To automatically calculate the next 4 days and dates when you enter a start
date, use the formulas below.
37

Time Sheet
2. Select the cells containing the times.
38

Time Sheet
3. Right click, click Format Cells, and select the right Time format. Use the
circled format for cell K12, K13 and K14.
39

Time Sheet
4. To automatically calculate the hours worked each day, the total hours and the overtime hours, use
the formulas below.
40