IF AND OR nested

AndyB63UK

New Member
Joined
Oct 5, 2011
Messages
47
Im trying to calculate work time and overtime. The basic hours are 8, overtime at time and a half is between 8 hours and 12 hours, and double time is over 12 hours. so if the total hours worked in G7 that day are 14:30, then how do I get cells Basic G8 = 8:00, OT 1.5 G9 = 4:00 and OT 2.0 G10 = 2:30. or it only 7:15 total in G7 then G8 = 7:15, G9 = blank, G10 = blank?

Hope that makes sense
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
See if these, copied across, do what you want.

Excel Workbook
FGHI
7Total14:307:1510:23
8Normal8:007:158:00
9OT(x1.5)4:002:23
10OT(x2)2:30
OT
 
Last edited:
Upvote 0
I can't seem to paste a copy of my sheet into here, but the column headings are;

Date, Start time, break 1, break 2, break 3, finish time, total hours, basic, OT 1.5, OT 2
Mon 1,
Tue 2,
Wed 3,
Thu 4,
Fri 5,
Sat 6,
Sun 7,

Saturday is always OT1.5 for first 8 hours the OT2
Sunday is always OT2 regardless

Thanks
 
Last edited:
Upvote 0
Apart from the weekend issue that you have now added, did the previous formulas do what you wanted? If not which one(s) gave the wrong answers and what should the correct answers have been?

Does your Date column contain actual dates (numbers) or just text?

For posting small sample screen shots like I did, read my signature block below.
 
Last edited:
Upvote 0
ABCDEFGHIJ
5DateStartBreaksFinishTotalBasicOT 1.5OT 2.0
6Time1st2nd3rdTimeHours8:0012:00>12:00
7
8
9
10
11
12
13
14Totals

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1
 
Last edited:
Upvote 0
Yes those formulas now work thank you, apart from the weekend issue.
The dates are formatted as ddd dd but taken from Week Ending, so A7 is =$H$2-6, A8 =$H$2-5 etc

I have another question relating to this sheet. Is there a way to enter time as just 4 digits without the colon AND without VBA. eg. for 08:45 just type 0845 or even just 845 and it be recognised as 08:45? I know this can be don with VBA code but that means a macro enabled file which the android excel app does not recognise or is able to open.
 
Last edited:
Upvote 0
Yes those formulas now work thank you, apart from the weekend issue.
Try these
H7: =MIN(G7,1/3*(WEEKDAY(A7,2)<6))
I7: =IF(WEEKDAY(A7,2)=7,0,IF(G7>H7,MIN(G7-H7,1/6+1/3*(H7=0)),0))
J7: =IF(G7>SUM(H7:I7),G7-SUM(H7:I7),0)


Is there a way to enter time as just 4 digits without the colon AND without VBA.
Not as far as I am aware.
 
Upvote 0
A quick example that you can experiment with.
I have never used this approach on a working time sheet but it may help you.

I have not used your cell references.


Excel 2010
JKLMN
1StartEndTime
2730120004:30:00Format as Time
3
4or
5
6800223014.50Format number
7
8Regular8.00
9OT @ 1.54
10OT @ 2.02.5
11
1a
Cell Formulas
RangeFormula
L2=TEXT(K2,"00\:00")+0-TEXT(J2,"00\:00")+0
L6=(TEXT(K6,"00\:00")+0-TEXT(J6,"00\:00")+0)*24
L8=MIN(8,L6)
L9=IF(L6>L8,MIN(L6-L8,4))
L10=IF(L6>12,L6-12,0)
 
Upvote 0

Forum statistics

Threads
1,214,412
Messages
6,119,369
Members
448,888
Latest member
Arle8907

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