Months between dates - round up

  • Thread starter Thread starter xlclue
  • Start date Start date
X

xlclue

How do I return the number of partial (and full) months between dates
for example, between 1/9/2004 and 5/20/2004? Answer should be
months.

In other words, two dates 5 days apart within or across months mus
round up to 1 month. 4 months, 2 days must round up to 5 months.
1/9/2004 and 1/15/2004 would result in 1 month. Excel 2000.

(Using DATEDIF hasn’t worked for me yet since it appears to return onl
full months between dates.)

Thanks
 
This might be close enough where d2 is the later date.
=ROUNDUP((D2-D1)/30,0)
 
Hi xlclue!

One way:

=DATEDIF(A1,B1,"m")+(DATEDIF(A1,B1,"md")>0)

The second part acts the same as an IF function and a return of TRUE
gets coerced by the maths to 1.
 
Thanks! Exactly what I needed. Elegant solutions too...and wit
amazing speed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top