You've asked for the FORMULA,
That implies that you don't want to use VBA, but wish to use Excel formulas.

Let's say that the date you're checking is in A2,

The simple answer is to subtract this year "Year(Today())"
>From the year of the of the date in A2 "Year(A2)"
giving:
YEAR(TODAY())-YEAR(A2)
The month calculation is similar:
MONTH(TODAY()) - MONTH(A2)

However, if the month happens to be AFTER the current month

For instance, checking December 12, 1954
Then the month calculation becomes negative.
In which case, you would need to subtract (1) from the year result,
and subtract this month difference from 12.

So, I'd say that the first thing you must do is check to see
if the month value of the date in question is after the current month,
then modify your formula accordingly:

=IF(MONTH(TODAY()) < MONTH(A2),
YEAR(TODAY())-YEAR(A2) - 1 &" years, " & 12+MONTH(TODAY()) - MONTH(A2) & " 
months",
YEAR(TODAY())-YEAR(A2) &" years, " & MONTH(TODAY()) - MONTH(A2) & " months")
 
Paul
-----------------------------------------
“Do all the good you can,
By all the means you can,
In all the ways you can,
In all the places you can,
At all the times you can,
To all the people you can,
As long as ever you can.” - John Wesley
-----------------------------------------




________________________________
From: excel lerner <exceller...@gmail.com>
To: excel-macros@googlegroups.com
Sent: Mon, November 5, 2012 6:42:06 AM
Subject: $$Excel-Macros$$ Calculate years and months between today daye and 
given date

Hello sir

Can you please explain how to get completd years ,Months bet ween
todays date and pevius year date.example

01/04/1954
05/11/2012

please tell me the formula
thanq sir

-- 
Join official facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES (1120+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 


6) Jobs posting is not allowed.

7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed.

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To post to this group, send email to excel-macros@googlegroups.com.
To unsubscribe from this group, send email to 
excel-macros+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros?hl=en.

-- 
Join official facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES (1120+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

6) Jobs posting is not allowed.

7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed.

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To post to this group, send email to excel-macros@googlegroups.com.
To unsubscribe from this group, send email to 
excel-macros+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros?hl=en.


Reply via email to