Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I have no idea where I've gone wrong. Given the following
cells: J13= Start Date & Time K13=End Date & Time AE66:AE83=Range of non-working holidays H5= Start of workday (a time) H6=End of workday (also a time) I've evolved (with a lot of help) the followng formula. It is supposed to return the number of workdays and workhours between the start date and time and the end date and time. Much of the time it works pretty well, but too often I'm getting negative hour counts. I have no idea where I've gone wrong. HELP! I'm desperate and tired. Here's the formula: =IF(AND(INT(J13)=INT(K13),NOT(ISNA(MATCH(INT(J13), AE66:AE83,0)))),"0 days 0 hours", IF(INT(J13)=INT(K13), "0 days " & ROUND(24*(K13-J13),2)&"hours", MAX(NETWORKDAYS(J13+1,K13-1,AE66:AE83),0)+ INT(24*(((K13-INT(K13))-(J13-INT(J13)))+ ('H6'-H5))/(24*('H6'-H5)))& " days "&MOD(ROUND(((24*(K13-INT(K13)))-24*H5)+ (24*'H6'-(24*(J13-INT(J13)))),2), ROUND((24*('H6'-H5)),2))&" hours ")) Does anyone know how I can rewrite this to make it consistent? All I need is, for a wide variety of starting and ending dates/times, to calculate the number of workdays and workhours between the two. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem with Array Formulas and ISNUMBER | Excel Worksheet Functions | |||
Circular Problem needs Macro | Excel Discussion (Misc queries) | |||
Freeze Pane problem in shared workbooks | Excel Discussion (Misc queries) | |||
Row Autofit problem Excel 2003 | Excel Discussion (Misc queries) | |||
Paper Tray selection Problem, | Excel Discussion (Misc queries) |