'if' formula help needed

pohteck89

New Member
Joined
Jul 5, 2012
Messages
1
Hi Guys,


I need help in this formula where i can auto calculate the total amount worked


Rules:
Office Hours 8.30am to 6.00pm - Rate is $7.50 per 15min block
After office hours 6.00pm onwards -Rate is $15 per $30min block


Examples
During office hours, 2.00pm - 5.15pm. Total amount will be $97.50 (3hrs 15mins)
During office hours, 2.00pm - 5.10pm. Total amount will be $97.50 (3hrs 10mins) *total amount is the same because it is within the 15mins block


After office hours, 2.00pm - 6.45pm. Total amount will be $150 (4hr 45mins) *from 2.00pm-6.00pm is $120. From 6.00pm to 6.45pm is $30, because 6.00pm-6.30pm is $15,6.30pm-6.45pm is $15 also as it is within the 30mins block


Anyone can help with this formula?
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Try this:
Excel Workbook
ABCDEFGH
1StartEndMinutes Before CutoffMinutes After CutoffTotal$
214:0017:15195097.50Work hrs rate7.5
314:0017:10190097.50Overtime rate15
414:0018:4524045150.00Cutoff time18:00
514:0018:002400120.00
618:0018:4504530.00
Sheet1
Excel 2003
Cell Formulas
RangeFormula
C2=IF(B2>$H$4,HOUR($H$4-A2)*60+MINUTE($H$4-A2),HOUR(B2-A2)*60+MINUTE(B2-A2))
D2=IF(B2>$H$4,HOUR(B2-$H$4)*60+MINUTE(B2-$H$4),0)
E2=INT(C2/15)*$H$2+IF(MOD(C2,15),$H$2) + INT(D2/30)*$H$3+IF(MOD(D2,30),$H$3)
 
Upvote 0

Forum statistics

Threads
1,214,645
Messages
6,120,711
Members
448,984
Latest member
foxpro

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