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

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
You need to reverse the dates, i.e.

=DATEDIF(B7,TODAY(),"y")&" years, "&DATEDIF(B7,TODAY(),"ym")&" months"
 
Upvote 0
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,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

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