Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 358
Default Determining work hours between dates / hours

I am currently using the following formula to calculate work hours. As it
happens on the time of measurement not all requests are finalised and I am
getting a #NUM! calculation. This have an impact on my total calculations.
How can I eliminate #NUM!

=IF(AND(INT(O94)=INT(V94),NOT(ISNA(MATCH(INT(O94), List!A$9:A$24,0)))),0,ABS(IF(INT(O94)=INT(V94),ROU ND(24*(V94-O94),2),
(24*(X94-W94)*
(MAX(NETWORKDAYS(O94+1,V94-1,List!A$9:A$24),0)+
INT(24*(((V94-INT(V94))-
(A94-INT(O94)))+(X94-W94))/(24*(X94-W94))))+
MOD(ROUND(((24*(V94-INT(V94)))-24*W94)+
(24*X94-(24*(O94-INT(O94)))),2),
ROUND((24*(X94-W94)),2))))))
--
Andrew
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Determining work hours between dates / hours

If you've got errors in a formula that long, the best bet for debugging it
is usually to break it down into manageable sized chunks until you find
where your problem is.
--
David Biddulph

"Andrew" wrote in message
...
I am currently using the following formula to calculate work hours. As it
happens on the time of measurement not all requests are finalised and I am
getting a #NUM! calculation. This have an impact on my total calculations.
How can I eliminate #NUM!

=IF(AND(INT(O94)=INT(V94),NOT(ISNA(MATCH(INT(O94), List!A$9:A$24,0)))),0,ABS(IF(INT(O94)=INT(V94),ROU ND(24*(V94-O94),2),
(24*(X94-W94)*
(MAX(NETWORKDAYS(O94+1,V94-1,List!A$9:A$24),0)+
INT(24*(((V94-INT(V94))-
(A94-INT(O94)))+(X94-W94))/(24*(X94-W94))))+
MOD(ROUND(((24*(V94-INT(V94)))-24*W94)+
(24*X94-(24*(O94-INT(O94)))),2),
ROUND((24*(X94-W94)),2))))))
--
Andrew



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Determining work hours between dates / hours

You may want to start with your NETWORKDAYS function. If you have given it
a negative number as a second argument, that would return #NUM!

If that is the problem, you may want to trap for that condition, such as:
=IF(OR(V94<1,AND(INT(O94)=INT(V94),NOT(ISNA(MATCH( INT(O94),List!A$9:A$24,0))))),0,ABS(IF(INT(O94)=IN T(V94),ROUND(24*(V94-O94),2),
(24*(X94-W94)*
(MAX(NETWORKDAYS(O94+1,V94-1,List!A$9:A$24),0)+
INT(24*(((V94-INT(V94))-
(A94-INT(O94)))+(X94-W94))/(24*(X94-W94))))+
MOD(ROUND(((24*(V94-INT(V94)))-24*W94)+
(24*X94-(24*(O94-INT(O94)))),2),
ROUND((24*(X94-W94)),2))))))
--
David Biddulph

"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
If you've got errors in a formula that long, the best bet for debugging it
is usually to break it down into manageable sized chunks until you find
where your problem is.
--
David Biddulph

"Andrew" wrote in message
...
I am currently using the following formula to calculate work hours. As it
happens on the time of measurement not all requests are finalised and I
am
getting a #NUM! calculation. This have an impact on my total
calculations.
How can I eliminate #NUM!

=IF(AND(INT(O94)=INT(V94),NOT(ISNA(MATCH(INT(O94), List!A$9:A$24,0)))),0,ABS(IF(INT(O94)=INT(V94),ROU ND(24*(V94-O94),2),
(24*(X94-W94)*
(MAX(NETWORKDAYS(O94+1,V94-1,List!A$9:A$24),0)+
INT(24*(((V94-INT(V94))-
(A94-INT(O94)))+(X94-W94))/(24*(X94-W94))))+
MOD(ROUND(((24*(V94-INT(V94)))-24*W94)+
(24*X94-(24*(O94-INT(O94)))),2),
ROUND((24*(X94-W94)),2))))))
--
Andrew





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 358
Default Determining work hours between dates / hours

Thanks David - On a glance it look if it will work - I will test further
--
Andrew


"David Biddulph" wrote:

If you've got errors in a formula that long, the best bet for debugging it
is usually to break it down into manageable sized chunks until you find
where your problem is.
--
David Biddulph

"Andrew" wrote in message
...
I am currently using the following formula to calculate work hours. As it
happens on the time of measurement not all requests are finalised and I am
getting a #NUM! calculation. This have an impact on my total calculations.
How can I eliminate #NUM!

=IF(AND(INT(O94)=INT(V94),NOT(ISNA(MATCH(INT(O94), List!A$9:A$24,0)))),0,ABS(IF(INT(O94)=INT(V94),ROU ND(24*(V94-O94),2),
(24*(X94-W94)*
(MAX(NETWORKDAYS(O94+1,V94-1,List!A$9:A$24),0)+
INT(24*(((V94-INT(V94))-
(A94-INT(O94)))+(X94-W94))/(24*(X94-W94))))+
MOD(ROUND(((24*(V94-INT(V94)))-24*W94)+
(24*X94-(24*(O94-INT(O94)))),2),
ROUND((24*(X94-W94)),2))))))
--
Andrew




Reply
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
WORK HOURS DIFFERENCE BETWEEN TWO DATES CHRISTI Excel Worksheet Functions 14 March 18th 20 08:16 AM
UDF To Calculate Work hours between two dates Problem with code jlclyde Excel Discussion (Misc queries) 4 August 13th 07 06:47 PM
wages - multiply hours and minutes by number of hours worked Carol (Australia) Excel Discussion (Misc queries) 6 April 1st 07 01:16 AM
Drivers Hours Timesheet - Calculate Hours Worked on Weekly Basis Graham Excel Discussion (Misc queries) 2 January 28th 07 08:40 PM
Calculate work hours between two dates trixiebme Excel Worksheet Functions 1 January 12th 05 07:37 PM


All times are GMT +1. The time now is 09:47 AM.

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"