phillipcook
Board Regular
- Joined
- Jun 25, 2015
- Messages
- 87
Hi Guys
I have the following formula:
=IF(G2="","",IF(NETWORKDAYS(B2,B2,V2:V22)>0,(H2-G2)-(MIN(18/24,H2)-MAX(6/24,G2)),0))
It seems to work 100% correct if the time consists of a proportion of it between 6am and 6pm, however what I am finding is if the start and finish times are both before 6am of if they are both after 6pm than the formula doesn't work.
for example I have a start time of 22:45 and a finish time of 23:45 which should equal 1 hour, however for some reason it is returning a total hours of 5:45???
Is there a way to fix this? my other thought was to calculate it out in 3 different cells. the first cell to work out the time between the start time and 6am (as long as it is Monday-Friday and not a public holiday (V2:V22)), the next cell time between 6pm and the finish time (as long as it is Monday-Friday and not a public holiday (V2:V22)) and lastly the 3rd cell which is simply a calculation of the two cells.
Let me know what you guys think?
Thanks in advance.
I have the following formula:
=IF(G2="","",IF(NETWORKDAYS(B2,B2,V2:V22)>0,(H2-G2)-(MIN(18/24,H2)-MAX(6/24,G2)),0))
It seems to work 100% correct if the time consists of a proportion of it between 6am and 6pm, however what I am finding is if the start and finish times are both before 6am of if they are both after 6pm than the formula doesn't work.
for example I have a start time of 22:45 and a finish time of 23:45 which should equal 1 hour, however for some reason it is returning a total hours of 5:45???
Is there a way to fix this? my other thought was to calculate it out in 3 different cells. the first cell to work out the time between the start time and 6am (as long as it is Monday-Friday and not a public holiday (V2:V22)), the next cell time between 6pm and the finish time (as long as it is Monday-Friday and not a public holiday (V2:V22)) and lastly the 3rd cell which is simply a calculation of the two cells.
Let me know what you guys think?
Thanks in advance.