Year/Month calculation

The Animal

Active Member
Joined
May 26, 2011
Messages
449
Hi
I am using below to use todays date and the entered date in cell B7 to calculate the years and months elapsed between the 2 but keep getting a #num error.
Any help would be great.

=DATEDIF(TODAY(),B7,"y")&" years, "&DATEDIF(TODAY(),B7,"ym")&" months"

Thanks Stephen
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
O fantastic that was easy thanks so much.
Another issue is that I have used your above and copied down and works perfect except if "B" cell is blank then give me 117 years and 9 months instead of a blank cell which is what I would like?
 
Upvote 0
You can use an IF function to return a blank if B7 is blank, e.g.

=IF(B7="","",DATEDIF(B7,TODAY(),"y")&" years, "&DATEDIF(B7,TODAY(),"ym")&" months")
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top