View Single Post
  #3   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Wed, 27 Oct 2004 09:23:07 -0700, Adam C <Adam
wrote:

Hi -

When I need to add a month, to a date. I use -

=DATE(YEAR(B27),MONTH(B27)+S21,MIN(DAY(B27),DAY(D ATE(YEAR(B27),MONTH(B27)+S22,0))))

However, I sometimes need to enter 1.5 months or 2.5. I figured out a way
to do this by looking at the number and figuring out if it is a decimal then
adding the decimal to the days -

=DATE(YEAR(N26),MONTH(N26),DAY(N26)+(DAY(P26)*L26 ))

My question is, how do I do this with one formula. It seems like a took the
long road to this solution.

Any suggestions?

Adam


Perhaps something like:

=MIN(DATE(YEAR(A1),MONTH(A1)+A2,DAY(A1)+MOD(A2,1)* 30),
DATE(YEAR(A1),MONTH(A1)+A2+1,0+MOD(A2,1)*30))

or, if you have the analysis tool pak installed:

=edate(A1,A2)+MOD(A2,1)*30


--ron