LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
B.D.
 
Posts: n/a
Default Stumper WORKDAYS Problem

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Array Formulas and ISNUMBER Henrik Excel Worksheet Functions 1 February 10th 05 12:31 AM
Circular Problem needs Macro NICK Excel Discussion (Misc queries) 2 February 1st 05 09:09 AM
Freeze Pane problem in shared workbooks JM Excel Discussion (Misc queries) 1 February 1st 05 12:04 AM
Row Autofit problem Excel 2003 Matthias Klaey Excel Discussion (Misc queries) 0 January 19th 05 05:33 PM
Paper Tray selection Problem, Michael Hoffmann Excel Discussion (Misc queries) 4 December 3rd 04 09:08 PM


All times are GMT +1. The time now is 07:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"