Formula not working when calculating time

MrsAndyTaylor

New Member
Joined
Mar 5, 2019
Messages
4
Hello!

I have a worksheet that has a list of times people are picking up extra hours. They get an incentive (-.50) if they work any three hours on Sunday(-.50); they get another incentive if they work between 0900-1300 (-.50), and/or 1830-2300 (-.50). The formula I have only works if they pick up exactly 0900-1300, or 1830-2300. So, if someone works 0900-1200 (3 hours), or 1800-2200 (4 hours) the formula isn't giving them the (-.50).


DEFHIJ
NameEmpEH FromEH ToSubtotal3 HR IncentiveAM IncentivePM Incentive
Last, FirstXXXX183022003:30-0.500.000.00

<tbody>
</tbody>

Column H formula [=IF(($E2-$D2)>=0.125,-0.5,0)]
Column I formula [=IF($D2<=TIME(9,0,0),IF($E2>=TIME(13,0,0),-0.5,0),0)]
Column J Formula [=IF($D2<=TIME(9,0,0),IF($E2>=TIME(13,0,0),-0.5,0),0)]
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi Andy,

Assuming employees can get both AM and PM incentives, try this:

Column H:
Code:
=IF(F2-E2>=300,0.5,"")

Column I:
Code:
=IF(OR(901=MEDIAN(E2:F2,901),1299=MEDIAN(E2:F2,1299)),0.5,"")

Column J:
Code:
=IF(OR(1831=MEDIAN(E2:F2,1831),2299=MEDIAN(E2:F2,2299)),0.5,"")

Does this do the trick?


All the best,
Matt
 
Upvote 0
Your first sentence mentions sunday. There is no reference to date on your example.
 
Upvote 0
Maybe...

I2
=IF(MIN(TIME(13,0,0),E2)-MAX(TIME(9,0,0),D2)>=0.125,-0.5,0)

J2
=IF(MIN(TIME(22,0,0),E2)-MAX(TIME(18,30,0),D2)>=0.125,-0.5,0)

Hope this helps

M.
 
Upvote 0

Forum statistics

Threads
1,216,098
Messages
6,128,812
Members
449,468
Latest member
AGreen17

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