Formula for time difference and deduct meak break

redspanna

Well-known Member
Joined
Jul 27, 2005
Messages
1,602
Office Version
  1. 365
Platform
  1. Windows
Hi al

Can somebody help with a formula that will check the time difference between two times (in column E & G) and if under 6hrs then deduct 15mins time and if => 6hrs then deduct 30mins
I currently use this formula (in column I) to calculate the time and deduct 30mins regardless
=IF(ISBLANK(H357),"",IF(H357="N",G357-E357,8/24)-(1/48))

EFGHI
26/03/2020 07:15:00​
26/03/2020 13:14:00​
N​
05:29​

So with above example the correct result in column I should be 05:44 as the time difference is under 6hrs and only 15mins should be deducted. not 30


TIA
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
In very simple terms, it would look like this
Code:
=IF(G1-E1<1/4,G1-E1-1/96,G1-E1-1/48)
, 1/4(6 hrs)
 
Upvote 0
In very simple terms, it would look like this
Code:
=IF(G1-E1<1/4,G1-E1-1/96,G1-E1-1/48)
, 1/4(6 hrs)

Excellent, how to adapt slightly also to show blank if column H holds a Y value (continue with formula if holds N value)
 
Upvote 0
Assuming it is only N that makes it execute then the formula, then
Code:
=IF(H1="N",IF(G1-E1<1/4,G1-E1-1/96,G1-E1-1/48),"")
 
Upvote 0

Forum statistics

Threads
1,214,998
Messages
6,122,638
Members
449,093
Latest member
Ahmad123098

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