Month Difference formula.

G

Guest

Hi,

Could someone please help me with the formula below.

I am trying to write a formula that will give the difference between a
future expiry date and NOW() in Months and Days in a single cell formula.
The formula I have come up with so far produces the difference in Weeks and
Days (eg: "4 Weeks And 6 Days"), but I can't work out how to do the same
formula in Months and days (eg "3 Months And 4 Days"). (Cell B1 contains the
'Expiry Date').

=CONCATENATE(INT((B1-NOW())/7)," Weeks and ",MOD(INT(B1-NOW()),7)," Days")

Thank you in advance for any help anyone can offer.
 
H

Harald Staff

Hi

Here's a start; difference in months with the later date in B1:

=12*(YEAR(B1)-YEAR(A1))+MONTH(B1)-MONTH(A1)-(DAY(B1)<DAY(A1))

HTH. Best wishes Harald
 

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