View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld Ron Rosenfeld is offline
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