Need duration formula to return 0:00 if result is negative

MasterK

New Member
Joined
Jan 15, 2015
Messages
15
I'm using the below formula to calculate duration of time within our business hours (L2 & K2) on days our company is open.
The issue we're having is that sometimes people need to work on a holiday and it returns a negative value. All I want to do
is modify this formula to return a value of zero if the result of the formula is negative. Right now I'm using another column and simple
if formula, but I know you can do it all-inclusive, I just can't remember how.

Excel Formula:
=IF(G2="","",(NETWORKDAYS(F2,G2,holidays!A:A)-1)*($L$1-$K$1) +IF(NETWORKDAYS(G2,G2),MEDIAN(MOD(G2,1),$L$1,$K$1),$L$1) -MEDIAN(NETWORKDAYS(F2,F2)*MOD(F2,1),$L$1,$K$1))

Thanks for any help
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,214,791
Messages
6,121,611
Members
449,038
Latest member
apwr

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