Time error

phillipcook

Board Regular
Joined
Jun 25, 2015
Messages
87
Hey guys I have the following formula:
=IF(G2=“”,””,IF(NETWORKDAYS(B2,B2,$S$2:$S$22)>0,MIN(18/24,H2)-(MAX(6/24,G2),0))

B column = date
S2:S22 = holidays
H column = finish time
G column = start time

what the formula is meant to do is if the date is a Monday - Friday and not a public holiday, calculate the total time worked between 6am and 6pm. The formula dose this, however I’m having issues with the formula when the start and finish times are both outside of the 6am-6pm area. The fact emulate cell is just displaying #########.

What i I need to do is have the formula display the cell as blank when there is no start time or the date is a weekend or holiday or if the day actually is actually a weekday but all of the hours worked are outside the 6am-6pm.

Thanks in advance.
 
Last edited:

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,216,105
Messages
6,128,859
Members
449,472
Latest member
ebc9

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