Numbers format help

Geek Girl 007

Board Regular
Joined
Mar 12, 2022
Messages
152
Office Version
  1. 2021
Platform
  1. Windows
Hi all,
I have created a specific Leave Sheet, it includes cells for an 11 hour day that equals 1 day, a public holiday that equals 1 day and the opportunity for ad-hoc leave, this is what I've done, however I know I miscalculated and I know the format cells are all wrong, any advice would be appreciated.

TIMESHEET-KIM PIPER.xlsx
DEFGHIJ
43LEAVEPUBLIC HOLIDAY
44W/C
4505/12/2022Hrs : MinsLeave DaysLeave hrsHrs : MinsDaysSELECT
46Monday0.027:241.0PH
47Tuesday11:001.0  
48Wednesday11:001.0  
49Thursday0.0  
50Friday0.0  
51
5222:002.07:241.0
53
54Totals
55Yearly Rollover AL (if appropriate)27141
56Hrs : MinsDays
57Previous AL27141
58Sub Total3.233
59Total26838
1 (3)
Cell Formulas
RangeFormula
H46H46=IF(OR(J46={"PH"}),TIME(7,24,0),"")
I46:I50I46=IFERROR(CEILING(H46*24/10,0.5), "")
H47H47=IF(OR(J47={"PH","no"}),TIME(7,24,0),"")
H48:H50H48=IF(OR(J48={"PH","Sick","Covid"}),TIME(7,24,0),"")
F46:F50F46=CEILING(E46*20/10,0.5)
E52:F52,H52:I52E52=SUM(E46:E50)
G57G57=I55
I57I57=J55
G58G58=E52+F52+H52
I58I58=F19+I19+F30+I30+F41+I41+F52+I52
G59,I59G59=G57-G58
Cells with Conditional Formatting
CellConditionCell FormatStop If True
G57:J59Cell Value=0textNO
J46:J50Cell Value=0textNO
H52Cell Value=0textNO
H52Expression=#REF!="Covid"textNO
H52Expression=#REF!="Sick"textNO
H52Expression=#REF!="Toil"textNO
H52Expression=#REF!="PH"textNO
I52Cell Value=0textNO
I52Expression=#REF!="Covid"textNO
I52Expression=#REF!="Sick"textNO
I52Expression=#REF!="Toil"textNO
I52Expression=#REF!="PH"textNO
F46:F50Cell Value=0textNO
E52:F52Cell Value=0textNO
E52:F52Expression=#REF!="Covid"textNO
E52:F52Expression=#REF!="Sick"textNO
E52:F52Expression=#REF!="Toil"textNO
E52:F52Expression=#REF!="PH"textNO
D52Cell Valuecontains "Excess Hours"textNO
Cells with Data Validation
CellAllowCriteria
E46:E50List=$N$19
J46:J50List=$N$10:$N$11
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hi, I tried that and this is what happened??
I don't know if I am going to be able to make this work?


TIMESHEET.xlsx
DEFGHIJK
43LEAVEPUBLIC HOLIDAY
44W/C
4505/12/2022Hrs : MinsLeave DaysLeave hrsHrs : MinsDaysSELECT
46Monday0.027:241.0PH
47Tuesday11:001.0  
48Wednesday11:001.0  
49Thursday0.0  
50Friday0.0  
51
5222:002.07:241.0
53
54Totals
55Yearly Rollover AL (if appropriate)2714141
56Hrs : MinsDays
57Previous AL27141
58Sub Total77:243
59Total6426:3638
1 (3)
Cell Formulas
RangeFormula
H46H46=IF(OR(J46={"PH"}),TIME(7,24,0),"")
I46:I50I46=IFERROR(CEILING(H46*24/10,0.5), "")
H47H47=IF(OR(J47={"PH","no"}),TIME(7,24,0),"")
H48:H50H48=IF(OR(J48={"PH","Sick","Covid"}),TIME(7,24,0),"")
F46:F50F46=CEILING(E46*20/10,0.5)
E52:F52,H52:I52E52=SUM(E46:E50)
G57G57=I55
I57I57=J55
G58G58=E52+F52+H52
I58I58=F19+I19+F30+I30+F41+I41+F52+I52
G59,I59G59=G57-G58
Cells with Conditional Formatting
CellConditionCell FormatStop If True
F46:F50Cell Value=0textNO
Cells with Data Validation
CellAllowCriteria
E46:E50List=$N$19
J46:J50List=$N$10:$N$11
 
Upvote 0
Problem
It looks like you want column G rows 56-59 to be in hours:minutes format. Let me know if that's incorrect.

Input
For cells E46:E50 and H46:H50 enter all your hh:mm times as they're shown. eg, you would enter 7:24 as 7:24.
For all cells on row 52 leave all your formulas as they are.

For "Previous AL" Excel is taking your 271 days as being 24 hour long days, to get your AL into the excel hours format you need to convert your days into hours, then back into days worth of pure leave. If your days are typically 11 hours, then the total AL in hours would be 271*11/24 = 124.2 days of leave. == 2,980.8 hours of leave available.
therefore the formula in cell G57 might be =I55*11/24

If that 271 figure is hours of leave, simply divide it by 24. G57 = I55/24. I'm assuming this in the below screenshot.

Formatting

1670885666531.png

format cells E46:E50, E52:F52 and G57:G59 with the custom number format [h]:mm Use the format painter icon to make this easier.

You should end up with something like this:
1670886639328.png
 
Upvote 0
Problem
It looks like you want column G rows 56-59 to be in hours:minutes format. Let me know if that's incorrect.

Input
For cells E46:E50 and H46:H50 enter all your hh:mm times as they're shown. eg, you would enter 7:24 as 7:24.
For all cells on row 52 leave all your formulas as they are.

For "Previous AL" Excel is taking your 271 days as being 24 hour long days, to get your AL into the excel hours format you need to convert your days into hours, then back into days worth of pure leave. If your days are typically 11 hours, then the total AL in hours would be 271*11/24 = 124.2 days of leave. == 2,980.8 hours of leave available.
therefore the formula in cell G57 might be =I55*11/24

If that 271 figure is hours of leave, simply divide it by 24. G57 = I55/24. I'm assuming this in the below screenshot.

Formatting

View attachment 80723
format cells E46:E50, E52:F52 and G57:G59 with the custom number format [h]:mm Use the format painter icon to make this easier.

You should end up with something like this:
View attachment 80725
I've tried to make this work but I am struggling.
I've changed it again without the days only hours....


The 11 hours is formatted in number the 7.24 is [h}:mm
I don't know how to make the totals add up :(
Can anyone help please?
TIMESHEET-KIM PIPER.xlsx
BCDEFGHIJK
10LEAVEPUBLIC HOLIDAY
11W/C
1228/02/2022Hrs : MinsLeave hrsHrs : MinsSELECT
13Monday117:24PH
14Tuesday11 
15Wednesday 
16Thursday 
17Friday7:24PH
18TOTAL
1922.000.0014:4822.62
1
Cell Formulas
RangeFormula
D12D12=E8
H13H13=IF(OR(I13={"PH"}),TIME(7,24,0),"")
H14H14=IF(OR(I14={"PH","no"}),TIME(7,24,0),"")
H15:H17H15=IF(OR(I15={"PH","Sick","Covid"}),TIME(7,24,0),"")
E19:F19,H19E19=SUM(E13:E17)
I19I19=SUM(E19:H19)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
I13:I17Cell Value=0textNO
H19Cell Value=0textNO
H19Expression=#REF!="Covid"textNO
H19Expression=#REF!="Sick"textNO
H19Expression=#REF!="Toil"textNO
H19Expression=#REF!="PH"textNO
E19:F19Cell Value=0textNO
E19:F19Expression=#REF!="Covid"textNO
E19:F19Expression=#REF!="Sick"textNO
E19:F19Expression=#REF!="Toil"textNO
E19:F19Expression=#REF!="PH"textNO
D19Cell Valuecontains "Excess Hours"textNO
Cells with Data Validation
CellAllowCriteria
I13:I17List=$M$3:$M$4
E13:E17List=$L$3:$L$4
 
Upvote 0
The cells only add up in a way you expect when they are all the same format. The common format in your speadsheet is hours.
You need this [h]:mm in your custom format for the cells listed in my answer.

Highlight the cells with hours in them and press "crtl 1" then paste [h]:mm into the custom number format box.


Once you're able to convert everything to hours, it's just a case of tweaking the formulas so that the hours of leave convert to days of leave, that's done with a formula to work out how many hours of paid leave = 1 day of paid leave.
 
Upvote 0
Solution
The cells only add up in a way you expect when they are all the same format. The common format in your speadsheet is hours.
You need this [h]:mm in your custom format for the cells listed in my answer.

Highlight the cells with hours in them and press "crtl 1" then paste [h]:mm into the custom number format box.


Once you're able to convert everything to hours, it's just a case of tweaking the formulas so that the hours of leave convert to days of leave, that's done with a formula to work out how many hours of paid leave = 1 day of paid leave
Hi,
I gave up on the 'days' part of this sheet as this member of staff works different hours to a standard day, so it will be for them to work out.
So I reformatted it like this and now I have these numbers.......... I don't know how to make it work!
TIMESHEET-LEAVE.xlsx
BCDEFGHIJK
2
3
4
5
6 Name: .
7
828/02/2022<-- Insert start date here
9
10LEAVEPUBLIC HOLIDAY
11W/C
1228/02/2022Hrs : MinsLeave hrsHrs : MinsSELECT
13Monday264:007:24PH
14Tuesday264:00 
15Wednesday 
16Thursday 
17Friday7:24PH
18TOTAL
1922.000.0014:4822.62
20
21LEAVEPUBLIC HOLIDAY
22W/C
2307/03/2022Hrs : MinsLeave hrsHrs : MinsSELECT
24Monday 
25Tuesday 
26Wednesday 
27Thursday 
28Friday 
29
300:000:000:000:00
31
32LEAVEPUBLIC HOLIDAY
33W/C
3414/03/2022Hrs : MinsLeave hrsHrs : MinsSELECT
35Monday 
36Tuesday 
37Wednesday 
38Thursday 
39Friday 
40
410:000:000:000:00
42
43LEAVEPUBLIC HOLIDAY
44W/C
4521/03/2022Hrs : MinsLeave hrsHrs : MinsSELECT
46Monday 
47Tuesday 
48Wednesday 
49Thursday 
50Friday 
51
520:000:000:000:00
53
54Totals
55Yearly Rollover AL (if appropriate)27141
56Hrs : Mins
57Previous AL6504:00
58Sub Total542:48
59Total5961:12
60
61
62
63
1
Cell Formulas
RangeFormula
D12D12=E8
H13,H46,H35,H24H13=IF(OR(I13={"PH"}),TIME(7,24,0),"")
H14,H47,H36,H25H14=IF(OR(I14={"PH","no"}),TIME(7,24,0),"")
H15:H17,H48:H50,H37:H39,H26:H28H15=IF(OR(I15={"PH","Sick","Covid"}),TIME(7,24,0),"")
E19:F19,E52:F52,E41:F41,E30:F30,H19E19=SUM(E13:E17)
I19,I52,I41,I30I19=SUM(E19:H19)
D23,D45,D34D23=D12+7
H30,H52,H41H30=SUM(H24:H27)
H57H57=H55
H58H58=I19+I30+I41+I52
H59H59=H57-H58
Cells with Conditional Formatting
CellConditionCell FormatStop If True
I46:I50Cell Value=0textNO
I35:I39Cell Value=0textNO
I24:I28Cell Value=0textNO
H52Cell Value=0textNO
E52:F52Cell Value=0textNO
D52Cell Valuecontains "Excess Hours"textNO
H41Cell Value=0textNO
E41:F41Cell Value=0textNO
D41Cell Valuecontains "Excess Hours"textNO
H30Cell Value=0textNO
E30:F30Cell Value=0textNO
D30Cell Valuecontains "Excess Hours"textNO
I13:I17Cell Value=0textNO
H19Cell Value=0textNO
E19:F19Cell Value=0textNO
D19Cell Valuecontains "Excess Hours"textNO
H57:I59Cell Value=0textNO
E8Cellcontains a blank value textNO
E8Cell Valuecontains "Type your name in here."textNO
E6Cell Valuecontains "Type your name in here."textNO
Cells with Data Validation
CellAllowCriteria
E24:E28List=$M$19
E46:E50List=$M$19
E35:E39List=$M$19
I13:I17List=$M$3:$M$4
I24:I28List=$M$3:$M$4
I35:I39List=$M$3:$M$4
I46:I50List=$M$3:$M$4
E13:E17List=$L$3:$L$4
 
Upvote 0
Hi,
I gave up on the 'days' part of this sheet as this member of staff works different hours to a standard day, so it will be for them to work out.
So I reformatted it like this and now I have these numbers.......... I don't know how to make it work!
TIMESHEET-LEAVE.xlsx
BCDEFGHIJK
2
3
4
5
6 Name: .
7
828/02/2022<-- Insert start date here
9
10LEAVEPUBLIC HOLIDAY
11W/C
1228/02/2022Hrs : MinsLeave hrsHrs : MinsSELECT
13Monday264:007:24PH
14Tuesday264:00 
15Wednesday 
16Thursday 
17Friday7:24PH
18TOTAL
1922.000.0014:4822.62
20
21LEAVEPUBLIC HOLIDAY
22W/C
2307/03/2022Hrs : MinsLeave hrsHrs : MinsSELECT
24Monday 
25Tuesday 
26Wednesday 
27Thursday 
28Friday 
29
300:000:000:000:00
31
32LEAVEPUBLIC HOLIDAY
33W/C
3414/03/2022Hrs : MinsLeave hrsHrs : MinsSELECT
35Monday 
36Tuesday 
37Wednesday 
38Thursday 
39Friday 
40
410:000:000:000:00
42
43LEAVEPUBLIC HOLIDAY
44W/C
4521/03/2022Hrs : MinsLeave hrsHrs : MinsSELECT
46Monday 
47Tuesday 
48Wednesday 
49Thursday 
50Friday 
51
520:000:000:000:00
53
54Totals
55Yearly Rollover AL (if appropriate)27141
56Hrs : Mins
57Previous AL6504:00
58Sub Total542:48
59Total5961:12
60
61
62
63
1
Cell Formulas
RangeFormula
D12D12=E8
H13,H46,H35,H24H13=IF(OR(I13={"PH"}),TIME(7,24,0),"")
H14,H47,H36,H25H14=IF(OR(I14={"PH","no"}),TIME(7,24,0),"")
H15:H17,H48:H50,H37:H39,H26:H28H15=IF(OR(I15={"PH","Sick","Covid"}),TIME(7,24,0),"")
E19:F19,E52:F52,E41:F41,E30:F30,H19E19=SUM(E13:E17)
I19,I52,I41,I30I19=SUM(E19:H19)
D23,D45,D34D23=D12+7
H30,H52,H41H30=SUM(H24:H27)
H57H57=H55
H58H58=I19+I30+I41+I52
H59H59=H57-H58
Cells with Conditional Formatting
CellConditionCell FormatStop If True
I46:I50Cell Value=0textNO
I35:I39Cell Value=0textNO
I24:I28Cell Value=0textNO
H52Cell Value=0textNO
E52:F52Cell Value=0textNO
D52Cell Valuecontains "Excess Hours"textNO
H41Cell Value=0textNO
E41:F41Cell Value=0textNO
D41Cell Valuecontains "Excess Hours"textNO
H30Cell Value=0textNO
E30:F30Cell Value=0textNO
D30Cell Valuecontains "Excess Hours"textNO
I13:I17Cell Value=0textNO
H19Cell Value=0textNO
E19:F19Cell Value=0textNO
D19Cell Valuecontains "Excess Hours"textNO
H57:I59Cell Value=0textNO
E8Cellcontains a blank value textNO
E8Cell Valuecontains "Type your name in here."textNO
E6Cell Valuecontains "Type your name in here."textNO
Cells with Data Validation
CellAllowCriteria
E24:E28List=$M$19
E46:E50List=$M$19
E35:E39List=$M$19
I13:I17List=$M$3:$M$4
I24:I28List=$M$3:$M$4
I35:I39List=$M$3:$M$4
I46:I50List=$M$3:$M$4
E13:E17List=$L$3:$L$4


Hi I still hadn't formatted them all, this is the full sheet.
Public holiday will always be 7.24
full day will always be 11.00 and Ad Hoc will be Ad Hoc.... I don't know how to format it to give me a runnign total.
Can you help?

TIMESHEET-LEAVE.xlsx
BCDEFGHIJK
2
3
4
5
6 Name: .Type your name in here.
7
8<-- Insert start date here
9
10LEAVEPUBLIC HOLIDAY
11W/C
1200/01/1900Full DayAd HocHrs : MinsSELECT
13Monday264:007:24PH
14Tuesday264:00 
15Wednesday 
16Thursday 
17Friday7:24PH
18TOTAL
19528:000:0014:48542:48
20
21LEAVEPUBLIC HOLIDAY
22W/C
2307/01/1900Full DayAd HocHrs : MinsSELECT
24Monday 
25Tuesday 
26Wednesday 
27Thursday 
28Friday 
29TOTAL
300:000:000:000:00
31
32LEAVEPUBLIC HOLIDAY
33W/C
3414/01/1900Full DayAd HocHrs : MinsSELECT
35Monday 
36Tuesday 
37Wednesday 
38Thursday 
39Friday 
40TOTAL
410:000:000:000:00
42
43LEAVEPUBLIC HOLIDAY
44W/C
4521/01/1900Full DayAd HocHrs : MinsSELECT
46Monday 
47Tuesday 
48Wednesday 
49Thursday 
50Friday 
51TOTAL
520:000:000:000:00
53
54Totals
55Yearly Rollover AL (if appropriate)6504:0041
56Hrs : Mins
57Previous AL6504:00
58Sub Total542:48
59Total5961:12
60
61
62
63
1
Cell Formulas
RangeFormula
D12D12=E8
H13,H46,H35,H24H13=IF(OR(I13={"PH"}),TIME(7,24,0),"")
H14,H47,H36,H25H14=IF(OR(I14={"PH","no"}),TIME(7,24,0),"")
H15:H17,H48:H50,H37:H39,H26:H28H15=IF(OR(I15={"PH","Sick","Covid"}),TIME(7,24,0),"")
E19:F19,H52,E52:F52,H41,E41:F41,H30,E30:F30,H19E19=SUM(E13:E17)
I19,I52,I41,I30I19=SUM(E19:H19)
D23,D45,D34D23=D12+7
H57H57=H55
H58H58=I19+I30+I41+I52
H59H59=H57-H58
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E19:F19,H19:I19,E30:F30,H30:I30,E41:F41,H41:I41,E52:F52,H52:I52,H57:I59,H55:I55Cell Value=0textNO
E8Cellcontains a blank value textNO
E6Cell Valuecontains "Type your name in here."textNO
Cells with Data Validation
CellAllowCriteria
E24:E28List=$M$19
E46:E50List=$M$19
E35:E39List=$M$19
I13:I17List=$M$3:$M$4
I24:I28List=$M$3:$M$4
I35:I39List=$M$3:$M$4
I46:I50List=$M$3:$M$4
E13:E17List=$L$3:$L$4
 
Upvote 0
Hi,
I worked it out, i needed to change the number format to 11:00 instead of 11.
Thank you all for your help.
Happy New Year!!
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top