0% found this document useful (0 votes)
437 views4 pages

Age Calculation

This document provides information on calculating and working with time values in Excel. It discusses entering time in different formats, subtracting times to find durations, adding times including dealing with totals over 24 hours using custom formatting, and includes an example timesheet template. It also describes using the DATEDIF and DATE functions to calculate a person's age based on their birthday.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLS, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
437 views4 pages

Age Calculation

This document provides information on calculating and working with time values in Excel. It discusses entering time in different formats, subtracting times to find durations, adding times including dealing with totals over 24 hours using custom formatting, and includes an example timesheet template. It also describes using the DATEDIF and DATE functions to calculate a person's age based on their birthday.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLS, PDF, TXT or read online on Scribd
You are on page 1/ 4

Excel Function Dictionary Time Calculation

© 1998 - 2000 Peter Noneley Page 1 of 4

A B C D E F G H I J
1 Time Calculation
2
3 Excel can work with time very easily.
4 Time can be entered in various different formats and calculations performed.
5 There are one or two oddities, but nothing which should put you off working with it.
6 See the TimeSheet example for an example.
7
8 Typing time
9 When time is entered into worksheet it should be entered with a colon between
10 the hour and the minutes, such as 12:30, rather than 12.30
11
12 1:30 12:30 20:15 22:45
13
14 Excel can cope with either the 24hour system or the am/pm system.
15 To use the am/pm system you must enter the am or pm after the time.
16 You must leave a space between the number and the text.
17
18 1:30 AM 1:30 PM 10:15 AM 10:15 PM
19
20 Finding the difference between two times
21 You can subtract two time values to find the length of time between.
22
23 Start End Duration
24 1:30 2:30 1:00 =D24-C24
25 8:00 17:00 9:00 =D25-C25
26 8:00 AM 5:00 PM 9:00 AM If the result is not shown correctly,
27 You may need to reformat the answer.
28 Look at the section about formatting
29 further in this worksheet.
30
31 Adding time
32 You can add time to find a total time.
33 This works well until the total time goes above 24 hours.
34 For totals greater than 24 hours you may need to apply some special formatting.
35
36 Start End Duration
37 1:30 2:30 1:00
38 8:00 17:00 9:00
39 7:30 AM 5:45 PM 10:15
40 20:15
41
42 Formatting time
43 When time is added together the result may go beyond 24 hours.
44 Usually this gives an incorrect result, as in the example below.
45 To correct this error, the result needs to be formatted with a Custom format.
46
47 Example 1 : Incorrect formatting
48 Start End Duration
49 7:00 18:30 11:30
50 8:00 17:00 9:00
51 7:30 17:45 10:15
52 Total 6:45 =SUM(E49:E51)
53
54 Example 2 : Correct formatting
55 Start End Duration
56 7:00 18:30 11:30
57 8:00 17:00 9:00
58 7:30 17:45 10:15
59 Total 30:45 =SUM(E56:E58)
60
61
62 How To Apply Custom Formatting
63 The custom format for time use a pair of square brackets [hh] on either side
64 of the hours indicators.
65
66 1. Click on the cell which needs the format.
67 2. Choose the Format menu.
Excel Function Dictionary Time Calculation
© 1998 - 2000 Peter Noneley Page 2 of 4

A B C D E F G H I J
68 3. Choose Cells.
69 4. Click the Number tag at the top right.
70 5. Choose Custom.
71 6. Click inside the Type: box.
72 7. Type [hh]:mm as the format.
73 8. Click OK to confirm.
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Excel Function Dictionary TimeSheet For Flexi
© 1998 - 2000 Peter Noneley Page 3 of 4

A B C D E F G H I J K
1
2
3 Week beginning Mon 05-Jan-98 Normal Hours 37:30
4
5 Day Arrive Lunch Out Lunch In Depart Total
6 Mon 05 8:00 13:00 14:00 17:00 8:00 =(F6-C6)-(E6-D6)
7 Tue 06 8:45 12:30 13:30 17:00 7:15
8 Wed 07 9:00 13:00 14:00 18:00 8:00
9 Thu 08 8:30 13:00 14:00 17:00 7:30
10 Fri 09 8:00 12:00 13:00 17:00 8:00
11 Total Hours 38:45 =SUM(G6:G10)
12
13 Under worked by - =IF(G3-G11>0,G3-G11, "-")
14 Over worked by 1:15 =IF(G3-G11<0,ABS(G3-G11),"-")
15
16 This is simple example of a timesheet.
17
18 Instructions :
19 Type the week start date in cell C3, the Week beginning.
20 Use the format dd/mm/yy, the name of the day will appear automatically.
21 The date is then passed down to the Day column.
22
23 Type the amount of hours you are expected to work in G3, the Normal Hours.
24 This is used later to calculate if have worked over or under the required hours.
25
26 Type the times you arrive and leave work in the appropriate columns.
27 Use the format of hh:mm.
28
29 Note
30 The Total Hours cell has been formatted as [hh]:mm.
31 This ensures the total hours can be expressed as a value above 24 hours.
32 If the [hh]:mm format had not been used the Total Hours would show as : 14:45
33 If the [hh]:mm format does not show in the cell format dialog box
34 on your computer, it can be created using Format, Cells, Number, Custom.
Excel Function Dictionary Age Calculation
© 1998 - 2000 Peter Noneley Page 4 of 4

A B C D E F G H
1 Age Calculation
2
3 You can calculate a persons age based on their birthday and todays date.
4 The calculation uses the DATEDIF() function.
5 The DATEDIF() is not documented in Excel 5, 7 or 97, but it is in 2000.
6 (Makes you wonder what else Microsoft forgot to tell us!)
7 11/8/2023
8 Birth date : 6-Nov-75
9
10 Years lived : 48 =DATEDIF(C8,TODAY(),"y")
11 and the months : 0 =DATEDIF(C8,TODAY(),"ym")
12 and the days : 2 =DATEDIF(C8,TODAY(),"md")
13
14 You can put this all together in one calculation, which creates a text version.
15 Age is 48 Years, 0 Months and 2 Days
16 ="Age is "&DATEDIF(C8,TODAY(),"y")&" Years, "&DATEDIF(C8,TODAY(),"ym")&" Months and "&DATEDIF(C8,TODAY(),"md")&" Days"
17
18
19 Another way to calculate age
20 This method gives you an age which may potentially have decimal places representing the months.
21 If the age is 20.5, the .5 represents 6 months.
22
23 Birth date : 6-Nov-75
24
25 Age is : 48.01 =(TODAY()-C23)/365.25

You might also like