Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 86
Default Count distinct days from two groups of days

Hello,

Can anybody help please?

I have used Networkdays() to count the working days between two dates. And
have had to do this twice. So now have two counts that I will add together.

But if the same particular date is in both count sets I dont want to count
it twice?

Hope this makes sense,

Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Count distinct days from two groups of days

On Tue, 16 Feb 2010 19:51:01 -0800, Colin
wrote:

Hello,

Can anybody help please?

I have used Networkdays() to count the working days between two dates. And
have had to do this twice. So now have two counts that I will add together.

But if the same particular date is in both count sets I dont want to count
it twice?

Hope this makes sense,

Thanks in advance


It depends on how your data is set up but

If you are using NETWORKDAYS on two sets of data and
there are particular dates in both sets, then
it must be the case that the date ranges overlap.

If the date ranges overlap, and if the holiday dates are the same for both
ranges, then you could just use NETWORKDAYS using the earliest start date and
the latest end date.

And you could test to see if there is an overlap.

So maybe something like:

=IF(StartDate2<=EndDate1,NETWORKDAYS(StartDate1,En dDate2),
NETWORKDAYS(StartDate1,EndDate1)+NETWORKDAYS(Start Date2,EndDate2))

--ron
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 52
Default Count distinct days from two groups of days

=IF(B1<A2,NETWORKDAYS(A2,B2),NETWORKDAYS(B1,B2))-1
In B3 where your ranges are in A1:A2 and B1:B2
Crude I know
--
Russell Dawson
Excel Student


"Colin" wrote:

Hello,

Can anybody help please?

I have used Networkdays() to count the working days between two dates. And
have had to do this twice. So now have two counts that I will add together.

But if the same particular date is in both count sets I dont want to count
it twice?

Hope this makes sense,

Thanks in advance

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Count distinct days from two groups of days

Just to add on to what Ron has posted...

If the date series are not in sequential order; try
A1 = StartDate1
B1 = EndDate1

A2 = StartDate2
B2 = EndDate2

=IF(MEDIAN(A1,B1,A2)=A2,NETWORKDAYS(MIN(A1,A2),
MAX(B1,B2)),NETWORKDAYS(A1,B1)+NETWORKDAYS(A2,B2))

--
Jacob


"Colin" wrote:

Hello,

Can anybody help please?

I have used Networkdays() to count the working days between two dates. And
have had to do this twice. So now have two counts that I will add together.

But if the same particular date is in both count sets I dont want to count
it twice?

Hope this makes sense,

Thanks in advance

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 86
Default Count distinct days from two groups of days

Thank you all very much for the quick and useful responses.
The two date ranges are sequential inside their own sets, but one set could
come wholly before, during, overlapping or after the second.

Would the best way be to use the Median() check as advised by Jacob but
check for A1 being the middle date also?


"Jacob Skaria" wrote:

Just to add on to what Ron has posted...

If the date series are not in sequential order; try
A1 = StartDate1
B1 = EndDate1

A2 = StartDate2
B2 = EndDate2

=IF(MEDIAN(A1,B1,A2)=A2,NETWORKDAYS(MIN(A1,A2),
MAX(B1,B2)),NETWORKDAYS(A1,B1)+NETWORKDAYS(A2,B2))

--
Jacob


"Colin" wrote:

Hello,

Can anybody help please?

I have used Networkdays() to count the working days between two dates. And
have had to do this twice. So now have two counts that I will add together.

But if the same particular date is in both count sets I dont want to count
it twice?

Hope this makes sense,

Thanks in advance

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
Need to pull <=14 Days, <=30 Days, 30 Days from a date column Ken Excel Discussion (Misc queries) 3 October 23rd 09 12:53 AM
Employee days worked (-Holidays, -weekends, Snow Days, etc) Denise Excel Discussion (Misc queries) 2 December 31st 08 04:37 PM
Count Days more than 180 days prior to today Gregory Day Excel Worksheet Functions 4 March 28th 08 10:16 PM
When word says Install I want it count the days for 3 days w.o wee CYNTHIA Excel Worksheet Functions 1 March 23rd 08 05:28 AM
COUNT how many ROWS ago out of 10 days that the highest high in 10 days was made rhhince Excel Worksheet Functions 1 January 14th 07 09:56 PM


All times are GMT +1. The time now is 03:34 AM.

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

About Us

"It's about Microsoft Excel"