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

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
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,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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