Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Help need formula for working out date overlaps

Hope someone can help, I'm looking for a formula to work out date overlaps.
e.g.
If my key dates are 1/11/08 to 30/11/08
I want to auto calculate how many days the following overlap with my key dates
01/01/08 to 31/12/08
16/11/08 to 05/12/08
etc

thanks!
--
Liz
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,420
Default Help need formula for working out date overlaps

=MAX(0,MIN(KeyDateEnd,$B1+1)-MAX(KeyDateStart,$A1))+1

--
__________________________________
HTH

Bob

"liztownsend" wrote in message
...
Hope someone can help, I'm looking for a formula to work out date
overlaps.
e.g.
If my key dates are 1/11/08 to 30/11/08
I want to auto calculate how many days the following overlap with my key
dates
01/01/08 to 31/12/08
16/11/08 to 05/12/08
etc

thanks!
--
Liz



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,180
Default Help need formula for working out date overlaps

Try
1/1/2008 20/11/2008
9/11/2008 11/11/2008
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 915
Default Help need formula for working out date overlaps

Herbert Seidenberg wrote:
Try
1/1/2008 20/11/2008
9/11/2008 11/11/2008


Ah, a misplaced paren:

=MAX(0,MIN(KeyDateEnd,$B1)+1-MAX(KeyDateStart,$A1))+1
^^^
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 915
Default Help need formula for working out date overlaps

smartin wrote:
Herbert Seidenberg wrote:
Try
1/1/2008 20/11/2008
9/11/2008 11/11/2008


Ah, a misplaced paren:

=MAX(0,MIN(KeyDateEnd,$B1)+1-MAX(KeyDateStart,$A1))+1
^^^


If anyone is still looking at this, I wonder if there is an array
solution that will do it? I think such a solution could have much wider
applications that touch on set operations.

E.g., In general, given two series of discreet values, denoted by their
respective endpoints,

series A: a...b
and
series B: c...d

1) Determine how many values are common to A and B, or
2) (better) Enumerate the values common to A and B so they can be
counted, summed, etc.
3) (going a step further) Enumerate the non-intersect values of A and B

Anyone up for a challenge? I know I am--and I dabbled at this, but my
grasp of handling arrays is feeble at best.


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,180
Default Help need formula for working out date overlaps

The problem is that
1/11/08 to 30/11/08
when fully expanded reads:
1/11/08 12:00 AM to 30/11/08 12:00 AM
What we really want is:
1/11/08 00:00 to 30/11/08 24:00
which shortens to:
1/11/08 to 1/12/08
If we correct all the end dates this way and
remove all the +1's in Bob's formula, everything works.
Ron's formula now fails and it has problems
if we include odd times.
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,420
Default Help need formula for working out date overlaps

Ron's is an array formula, but why use an array formula when you can do it
without.

--
__________________________________
HTH

Bob

"smartin" wrote in message
...
smartin wrote:
Herbert Seidenberg wrote:
Try
1/1/2008 20/11/2008
9/11/2008 11/11/2008


Ah, a misplaced paren:

=MAX(0,MIN(KeyDateEnd,$B1)+1-MAX(KeyDateStart,$A1))+1
^^^


If anyone is still looking at this, I wonder if there is an array solution
that will do it? I think such a solution could have much wider
applications that touch on set operations.

E.g., In general, given two series of discreet values, denoted by their
respective endpoints,

series A: a...b
and
series B: c...d

1) Determine how many values are common to A and B, or
2) (better) Enumerate the values common to A and B so they can be counted,
summed, etc.
3) (going a step further) Enumerate the non-intersect values of A and B

Anyone up for a challenge? I know I am--and I dabbled at this, but my
grasp of handling arrays is feeble at best.



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,420
Default Help need formula for working out date overlaps

I don't think so!

--
__________________________________
HTH

Bob

"smartin" wrote in message
...
Herbert Seidenberg wrote:
Try
1/1/2008 20/11/2008
9/11/2008 11/11/2008


Ah, a misplaced paren:

=MAX(0,MIN(KeyDateEnd,$B1)+1-MAX(KeyDateStart,$A1))+1
^^^



  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 915
Default Help need formula for working out date overlaps

Bob Phillips wrote:
I don't think so!


Heh! I must have missed something. Seemed like it worked, but I did not
test using nonzero times in the dates.
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Help need formula for working out date overlaps

On Thu, 11 Sep 2008 03:27:01 -0700, liztownsend
wrote:

Hope someone can help, I'm looking for a formula to work out date overlaps.
e.g.
If my key dates are 1/11/08 to 30/11/08
I want to auto calculate how many days the following overlap with my key dates
01/01/08 to 31/12/08
16/11/08 to 05/12/08
etc

thanks!



=SUMPRODUCT(--ISNUMBER(MATCH(ROW(INDIRECT(A5&":"&B5)),ROW(INDIRE CT(KeyDateStart&":"&KeyDateEnd)),0)))

Where your dates of interest are in A5 and B5
--ron


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
Calculation Total Time With Dates/Times That Overlaps Steve Gilley Excel Discussion (Misc queries) 4 February 18th 08 03:50 PM
Date in Formula not working Dana Excel Discussion (Misc queries) 12 February 28th 06 03:54 PM
Plotting Bands for Task Overlaps gtslabs Charts and Charting in Excel 1 December 5th 05 01:38 AM
Printing in Excel overlaps previous text Nash Excel Discussion (Misc queries) 2 November 8th 05 03:42 PM
Identifying Date Overlaps Tremain Excel Discussion (Misc queries) 1 May 10th 05 01:58 AM


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