LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,886
Default compare dates using a variable

Hi

If by intersect you mean that the resulting date is the same, then it
never will be with the example you posted.
With 10/May/2010 in A1 and 16/Jul/2007 in B1
=B1-A1 = 1029 days
=MOD(1029,6) =3
The dates can only be the same, in the case where MOD = 0.
i.e. there is no remainder when you divide the number of days difference
by 6.

The mid point will be
=(B1-A1)/2+A1
which is 11/Dec/2008 12:00

The nearest dates will be plus and minus 1.5 (half of the MOD value)
days from this date
="11/Dec/2008 12:00" -1.5 = 10/Dec/2008 00:00 and
="11/Dec/2008 12:00" +1.5 = 13/Dec/2008 00:00

--
Regards

Roger Govier


"old coach" wrote in message
...

i need to know when 2 dates intersect
1-i begin with todays date and add a variable to it
2-i then subtract the same variable from a future date
3-i need to know at what date the 2 intersect

example: 7-16-2007 + 6=7-22-2007 5-10-2010 - 6=5-4-2010
then: 7-22-2007 + 6=7-28-2007 5-4-2010 - 6=4-28-2010,
etc
this loop continues until they intersect.




--
old coach





 
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
compare dates Thea Excel Worksheet Functions 1 April 27th 07 01:17 AM
Compare two dates and if they are equal PeterArvidsson Excel Discussion (Misc queries) 1 April 21st 06 02:40 AM
how do I compare two dates? SlipperyPete Excel Worksheet Functions 3 April 19th 06 05:40 PM
Variable dates on X axis evenly spaced (should not be) Leo Bueno Charts and Charting in Excel 1 July 24th 05 04:16 PM
Compare range of dates and sum... SAL Excel Discussion (Misc queries) 5 March 22nd 05 02:59 PM


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