Months between dates - round up

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
 
N

Norman Harker

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.
 

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

Top