Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
Fia Fia is offline
external usenet poster
 
Posts: 3
Default calculate # of days from two different times

If A1=Date Reported, B2=Date Resolved, B3=Resolution Period
What formular should I use to:
1) calculate the resolution period in days, excluding weekends and public
holidays.
2) display "pending" in the Resolution Period cell if the Date Resolved cell
does not have a time value
3) display "impossible" in the Resolution Period cell if the value in the
Date Resolved Cell is less than the value in the Date reported cell
4) display "invalid" in the Resolution Period cell if either the Date
Resolved Cell or the Date Reported cell has no values.

Please assist...

--
Fia
Fiji Islands
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 168
Default calculate # of days from two different times

Hi Fia,

I think this should do what you want. (watch out for unwanted spaces if this
formula wraps)
=IF(INT(B2)-B2=0,"pending",IF(B2<A1,"Impossible",IF(OR(A1="",B 2=""),"Invalid",NETWORKDAYS(A1,B2))))

You will need to have the Analysis Tool Pack loaded otherwise
NETWORKDAYS will return a #NAME error.
Also look in the help file for how to add the public holidays
to the NETWORKDAYS function.

HTH
Martin


"Fia" wrote in message
...
If A1=Date Reported, B2=Date Resolved, B3=Resolution Period
What formular should I use to:
1) calculate the resolution period in days, excluding weekends and public
holidays.
2) display "pending" in the Resolution Period cell if the Date Resolved
cell
does not have a time value
3) display "impossible" in the Resolution Period cell if the value in the
Date Resolved Cell is less than the value in the Date reported cell
4) display "invalid" in the Resolution Period cell if either the Date
Resolved Cell or the Date Reported cell has no values.

Please assist...

--
Fia
Fiji Islands



  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 168
Default calculate # of days from two different times

Woops,

I got the order of the error checking back to front. This might work better.
=IF(OR(A1="",B2=""),"Invalid",IF(B2<A1,"Impossible ",IF(INT(B2)-B2=0,"pending",NETWORKDAYS(A1,B2))))

HTH
Martin


"MartinW" wrote in message
...
Hi Fia,

I think this should do what you want. (watch out for unwanted spaces if
this formula wraps)
=IF(INT(B2)-B2=0,"pending",IF(B2<A1,"Impossible",IF(OR(A1="",B 2=""),"Invalid",NETWORKDAYS(A1,B2))))

You will need to have the Analysis Tool Pack loaded otherwise
NETWORKDAYS will return a #NAME error.
Also look in the help file for how to add the public holidays
to the NETWORKDAYS function.

HTH
Martin


"Fia" wrote in message
...
If A1=Date Reported, B2=Date Resolved, B3=Resolution Period
What formular should I use to:
1) calculate the resolution period in days, excluding weekends and public
holidays.
2) display "pending" in the Resolution Period cell if the Date Resolved
cell
does not have a time value
3) display "impossible" in the Resolution Period cell if the value in the
Date Resolved Cell is less than the value in the Date reported cell
4) display "invalid" in the Resolution Period cell if either the Date
Resolved Cell or the Date Reported cell has no values.

Please assist...

--
Fia
Fiji Islands





  #4   Report Post  
Posted to microsoft.public.excel.newusers
Fia Fia is offline
external usenet poster
 
Posts: 3
Default calculate # of days from two different times

Hi Martin,
Thank you for replying.
"Pending" should only be diplayed if the Date Resolved column is empty.
Ideally, when users log an error report in the table, the Resolution Period
column should display the following values for each scenario:

DateReported DateResolved ResolutionPeriod
23/06/08 25/06/08 2
23/06/08 Pending
23/06/08 20/06/08 Impossible
20/06/08 Invalid
Invalid

Thanks,
--
Fia
Fiji Islands


"MartinW" wrote:

Woops,

I got the order of the error checking back to front. This might work better.
=IF(OR(A1="",B2=""),"Invalid",IF(B2<A1,"Impossible ",IF(INT(B2)-B2=0,"pending",NETWORKDAYS(A1,B2))))

HTH
Martin


"MartinW" wrote in message
...
Hi Fia,

I think this should do what you want. (watch out for unwanted spaces if
this formula wraps)
=IF(INT(B2)-B2=0,"pending",IF(B2<A1,"Impossible",IF(OR(A1="",B 2=""),"Invalid",NETWORKDAYS(A1,B2))))

You will need to have the Analysis Tool Pack loaded otherwise
NETWORKDAYS will return a #NAME error.
Also look in the help file for how to add the public holidays
to the NETWORKDAYS function.

HTH
Martin


"Fia" wrote in message
...
If A1=Date Reported, B2=Date Resolved, B3=Resolution Period
What formular should I use to:
1) calculate the resolution period in days, excluding weekends and public
holidays.
2) display "pending" in the Resolution Period cell if the Date Resolved
cell
does not have a time value
3) display "impossible" in the Resolution Period cell if the value in the
Date Resolved Cell is less than the value in the Date reported cell
4) display "invalid" in the Resolution Period cell if either the Date
Resolved Cell or the Date Reported cell has no values.

Please assist...

--
Fia
Fiji Islands






  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 46
Default calculate # of days from two different times

OK, so in your first post, in your second requirement, where you said 'time
value' you meant 'date value' and in your fourth requirement where you said
'either' you meant neither. Is that right?

If so then I think this should be what you are after.
=IF(AND(A1="",B2=""),"Invalid",IF(B2="","pending", IF(B2<A1,"Impossible",NETWORKDAYS(A1,B2))))

NETWORKDAYS counts whole days and therefore it will count 23/06/08 to
25/06/08 as 3.
To get it to return 2 you just have to subtract 1 from the result, so the
formula will be.
=IF(AND(A1="",B2=""),"Invalid",IF(B2="","pending", IF(B2<A1,"Impossible",NETWORKDAYS(A1,B2)-1)))

Does that work any better?

Regards
Martin

"Fia" wrote:

Hi Martin,
Thank you for replying.
"Pending" should only be diplayed if the Date Resolved column is empty.
Ideally, when users log an error report in the table, the Resolution Period
column should display the following values for each scenario:

DateReported DateResolved ResolutionPeriod
23/06/08 25/06/08 2
23/06/08 Pending
23/06/08 20/06/08 Impossible
20/06/08 Invalid
Invalid

Thanks,
--
Fia
Fiji Islands


"MartinW" wrote:

Woops,

I got the order of the error checking back to front. This might work better.
=IF(OR(A1="",B2=""),"Invalid",IF(B2<A1,"Impossible ",IF(INT(B2)-B2=0,"pending",NETWORKDAYS(A1,B2))))

HTH
Martin


"MartinW" wrote in message
...
Hi Fia,

I think this should do what you want. (watch out for unwanted spaces if
this formula wraps)
=IF(INT(B2)-B2=0,"pending",IF(B2<A1,"Impossible",IF(OR(A1="",B 2=""),"Invalid",NETWORKDAYS(A1,B2))))

You will need to have the Analysis Tool Pack loaded otherwise
NETWORKDAYS will return a #NAME error.
Also look in the help file for how to add the public holidays
to the NETWORKDAYS function.

HTH
Martin


"Fia" wrote in message
...
If A1=Date Reported, B2=Date Resolved, B3=Resolution Period
What formular should I use to:
1) calculate the resolution period in days, excluding weekends and public
holidays.
2) display "pending" in the Resolution Period cell if the Date Resolved
cell
does not have a time value
3) display "impossible" in the Resolution Period cell if the value in the
Date Resolved Cell is less than the value in the Date reported cell
4) display "invalid" in the Resolution Period cell if either the Date
Resolved Cell or the Date Reported cell has no values.

Please assist...

--
Fia
Fiji Islands







  #6   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 168
Default calculate # of days from two different times

OK, now I'm back on my own computer I can see your example formatted
properly. Try this.

=IF(OR(A1="",AND(A1="",B2="")),"Invalid",IF(B2="", "pending",IF(B2<A1,"Impossible",NETWORKDAYS(A1 ,B2)-1)))

HTH
Martin



"MartinW" wrote in message
...
OK, so in your first post, in your second requirement, where you said
'time
value' you meant 'date value' and in your fourth requirement where you
said
'either' you meant neither. Is that right?

If so then I think this should be what you are after.
=IF(AND(A1="",B2=""),"Invalid",IF(B2="","pending", IF(B2<A1,"Impossible",NETWORKDAYS(A1,B2))))

NETWORKDAYS counts whole days and therefore it will count 23/06/08 to
25/06/08 as 3.
To get it to return 2 you just have to subtract 1 from the result, so the
formula will be.
=IF(AND(A1="",B2=""),"Invalid",IF(B2="","pending", IF(B2<A1,"Impossible",NETWORKDAYS(A1,B2)-1)))

Does that work any better?

Regards
Martin

"Fia" wrote:

Hi Martin,
Thank you for replying.
"Pending" should only be diplayed if the Date Resolved column is empty.
Ideally, when users log an error report in the table, the Resolution
Period
column should display the following values for each scenario:

DateReported DateResolved ResolutionPeriod
23/06/08 25/06/08 2
23/06/08 Pending
23/06/08 20/06/08 Impossible
20/06/08 Invalid
Invalid

Thanks,
--
Fia
Fiji Islands


"MartinW" wrote:

Woops,

I got the order of the error checking back to front. This might work
better.
=IF(OR(A1="",B2=""),"Invalid",IF(B2<A1,"Impossible ",IF(INT(B2)-B2=0,"pending",NETWORKDAYS(A1,B2))))

HTH
Martin


"MartinW" wrote in message
...
Hi Fia,

I think this should do what you want. (watch out for unwanted spaces
if
this formula wraps)
=IF(INT(B2)-B2=0,"pending",IF(B2<A1,"Impossible",IF(OR(A1="",B 2=""),"Invalid",NETWORKDAYS(A1,B2))))

You will need to have the Analysis Tool Pack loaded otherwise
NETWORKDAYS will return a #NAME error.
Also look in the help file for how to add the public holidays
to the NETWORKDAYS function.

HTH
Martin


"Fia" wrote in message
...
If A1=Date Reported, B2=Date Resolved, B3=Resolution Period
What formular should I use to:
1) calculate the resolution period in days, excluding weekends and
public
holidays.
2) display "pending" in the Resolution Period cell if the Date
Resolved
cell
does not have a time value
3) display "impossible" in the Resolution Period cell if the value
in the
Date Resolved Cell is less than the value in the Date reported cell
4) display "invalid" in the Resolution Period cell if either the
Date
Resolved Cell or the Date Reported cell has no values.

Please assist...

--
Fia
Fiji Islands







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
Difference between dates/times in Days & Hours Steve Vincent Excel Discussion (Misc queries) 2 December 13th 07 08:40 AM
How do I calculate dates and times, w/answer of days & hours Debby_Jo Excel Worksheet Functions 4 April 27th 07 04:05 AM
Difference in two times over days SouthAfricanStan Excel Worksheet Functions 1 May 5th 06 07:08 AM
find days and hours between 2 sets of dates and times The Auditor Excel Discussion (Misc queries) 1 February 3rd 06 07:58 PM
Need to calulate a sum for once a month X #days X #times used per. pattyh Excel Worksheet Functions 0 September 28th 05 05:07 PM


All times are GMT +1. The time now is 04:53 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"