Calculate number of hours worked plus rate change

tezza

Active Member
Joined
Sep 10, 2006
Messages
375
Office Version
  1. 2016
  2. 2010
Platform
  1. Windows
  2. Web
Hi All,

Working hours is always one that catches me out so can you help please?

I just need something that breaks down the worked hours where the rate changes between certain times.

Example:
Working times are 19:00 to 22:00 (hours do go past midnight sometimes or starts before 09:00 and goes past it)

Standard rate in say 10.00 per hour where the times are between 09:00 - 20:00

Outside of that the rate jumps to 13.00 per hours

The above working time would then give an outcome of 1 hour @ 10.00 per hours, plus 2 hours @ 13.00 per hour, followed by a total 3 hours worked, total earned 36.00 (1 * 10 plus 2 * 13)

I need to adjust the rates easily so would like the rates set at A1 and A2

breakdown.png


Kind regards
Tezza
 
Please check the result of second row is this what you want ?

Book1
ABCDEFGHI
1Booking DateTime FromTime ToBasic RateAdv RsteBasicAdvTotal HoursTotal Erned
226-Feb-2219:00:0020:15:001:00:000:15:00103:15:001:15:0013.25
327-Feb-226:00:0012:00:001:00:005:00:001065:00:006:00:0075
Sheet1
Cell Formulas
RangeFormula
G2:G3G2=E2*13
H2:H3H2=C2-B2
I2:I3I2=(D2*24)*10+(E2*24)*13
E2:E3E2=C2-B2-D2
At what point does it break down and show how many basic rate hours someone has worked? Not the total hours.
 
Upvote 0

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
I have a spreadsheet make for me via this site it covers 24hr working and different rates for different times also bonus rates etc if your interested let me know it was designed for the transport industry as they have all different starts and finishes.
 
Upvote 0
overtime
Cell Formulas
RangeFormula
D2:D8,D10:D11D2=IF(COUNT(B2:C2)=2,N2-B2,0)
E2:E8,E10:E11E2=MIN(MAX(0,D2-TIME(8,45,0)),O2)
F2:F8,F10:F11F2=+(D2-E2)*(D2>0)
G2:G8,G10:G11G2=MAX(0,MAX(0,MIN(N2,STD_Stop)-MAX(B2,STD_start))+MAX(0,MIN(N2,1+STD_Stop)-MAX(B2,1+STD_start))-E2)
H2:H8,H10:H11H2=+MAX(0,F2-G2)
J2:J8,J10:J11J2=SUM(K2:N2)
K2:K8,K10:K11K2=24*$G2*Std
L2:L8,L10:L11L2=24*$H2*overtime
S2:S9,S11S2=IF(A2="",S1,"wk_"& TEXT(A2-WEEKDAY(A2)+1,"jj.mm.dd"))
T2:T11T2=IF(A2="","T","D")
N2:N8,N10:N11N2=+C2+(C2<B2)
D9:H9,J9:L9D9=SUBTOTAL(109,D2:D8)
S10S10=IF(A10="",#REF!,"wk_"& TEXT(A10-WEEKDAY(A10)+1,"jj.mm.dd"))
Named Ranges
NameRefers ToCells
overtime=Data!$AI$5L10:L11, L2:L8
Std=Data!$AI$4K10:K11, K2:K8
STD_start=Data!$AI$2G10:G11, G2:G8
STD_Stop=Data!$AI$3G10:G11, G2:G8
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D2:I992Expression=$D2<>$E2+$G2+$H2textYES
A2:S992Expression=EN($A2<>"";REST(RIJ($A2);2)=0)textNO
K2:N992,D2:I992Expression=EN($A2<>"";D2=0;1)textNO
Cells with Data Validation
CellAllowCriteria
B2:C11Whole numberbetween 0 and 1
 
Upvote 0
Solution
overtime
Cell Formulas
RangeFormula
D2:D8,D10:D11D2=IF(COUNT(B2:C2)=2,N2-B2,0)
E2:E8,E10:E11E2=MIN(MAX(0,D2-TIME(8,45,0)),O2)
F2:F8,F10:F11F2=+(D2-E2)*(D2>0)
G2:G8,G10:G11G2=MAX(0,MAX(0,MIN(N2,STD_Stop)-MAX(B2,STD_start))+MAX(0,MIN(N2,1+STD_Stop)-MAX(B2,1+STD_start))-E2)
H2:H8,H10:H11H2=+MAX(0,F2-G2)
J2:J8,J10:J11J2=SUM(K2:N2)
K2:K8,K10:K11K2=24*$G2*Std
L2:L8,L10:L11L2=24*$H2*overtime
S2:S9,S11S2=IF(A2="",S1,"wk_"& TEXT(A2-WEEKDAY(A2)+1,"jj.mm.dd"))
T2:T11T2=IF(A2="","T","D")
N2:N8,N10:N11N2=+C2+(C2<B2)
D9:H9,J9:L9D9=SUBTOTAL(109,D2:D8)
S10S10=IF(A10="",#REF!,"wk_"& TEXT(A10-WEEKDAY(A10)+1,"jj.mm.dd"))
Named Ranges
NameRefers ToCells
overtime=Data!$AI$5L10:L11, L2:L8
Std=Data!$AI$4K10:K11, K2:K8
STD_start=Data!$AI$2G10:G11, G2:G8
STD_Stop=Data!$AI$3G10:G11, G2:G8
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D2:I992Expression=$D2<>$E2+$G2+$H2textYES
A2:S992Expression=EN($A2<>"";REST(RIJ($A2);2)=0)textNO
K2:N992,D2:I992Expression=EN($A2<>"";D2=0;1)textNO
Cells with Data Validation
CellAllowCriteria
B2:C11Whole numberbetween 0 and 1
That works really well, thank you.
 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,625
Members
449,093
Latest member
catterz66

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