joeu2004:I must say that this post was over the top, and extremely
helpful. I was unaware about the existence of EDATE, and have enabled
the ATP on this machine.
The solutions and anaylsis you've brought to the surface are beyond
helpful, they showed a tremendous amount of professionalism, and for
lack of a group of better words: I'm speechless. You and the other
members in this group made my day.
Many many thanks.
Pierre
On Dec 13, 1:24*pm, joeu2004 <joeu2...@hotmail.com> wrote:
> On Dec 13, 7:05*am, Pierre <cow...@aol.com> wrote:
>
> > Need to use that date, and identify the range of days which will show
> > from that date: the entire year(s) that follow. *The results would be:
> > Col: A * * * * Col: B
> > 10/13/2010 10/12/2011
> > 10/13/2011/10/12/2012
> > 10/13/2012 10/12/2013
> > 10/13/2013 10/12/2014
>
> Many things will work with a starting date of 10/13/2010; and if that
> is the only starting date you care about, then you can use just about
> anything.
>
> But it might be instructive to consider a starting date of 2/29/2008.
>
> (Also test any solution with the following starting dates: *2/28/2007,
> 3/1/2008 and 3/31/2008.)
>
> First, I would like to see the following starting dates -- pay close
> attention to 2012:
>
> A2: 2/29/2008
> A3: 2/28/2009
> A4: 2/28/2010
> A5: 2/28/2011
> A6: 2/29/2012 <----
> A7: 2/28/2013
>
> If you agree, put the following formula into A3 and copy down through
> A7:
>
> =EDATE($A$2,12*(ROW()-ROW($A$2))
>
> Note that we cannot use simply EDATE(A2,12) because that would cause
> A6 to be 2/28/2012.
>
> Ergo, the ending dates in column B should be:
>
> B2: *2/27/2009
> B3: *2/27/2010
> B4: *2/27/2011
> B5: *2/28/2012 <---
> B6: *2/27/2013
> B7: *2/27/2014
>
> Note that putting DATE(YEAR(A2)+1,MONTH(A2),DAY(A2)-1) into B2 and
> copying down does not work for B2, B5 and B6.
>
> Also, putting EDATE(A2,12)-1 into B2 and copying down does not work
> for B5.
>
> It is tempting to put =A3-1 into B2 and copy down. *But that would
> require one more row after A7. *If that's okay, that is a simpler
> solution.
>
> Alternatively, put the following formula into B2 and copy down:
>
> =EDATE($A$2,12*(ROW()-ROW($A$2)+1))-1
>
> I believe EDATE is a standard function in XL2007 and later. *But it is
> in the Analysis ToolPak in XL2003. *If you get a #NAME error, you must
> install and/or select the ATP. *See the EDATE help page for
> instructions.
>
> If you cannot use EDATE, the following alternatives will work:
>
> A3:
> =IF(AND(MONTH($A$2)=2,DAY($A$2)=29),
> DATE(YEAR(A2)+1,MONTH(A2)+1,0),
> DATE(YEAR(A2)+1,MONTH(A2),DAY(A2)))
>
> B2:
> =IF(AND(MONTH($A$2)=2,DAY($A$2)=29),
> DATE(YEAR(A2)+1,MONTH(A2)+1,0),
> DATE(YEAR(A2)+1,MONTH(A2),DAY(A2)))-1
>
> Obviously in that case, putting =A3-1 into B2 would be more efficient,
> if you do not mind having the extra row in column A.