Finding years between dates

Dan Wilson

Active Member
Joined
Feb 5, 2006
Messages
448
Office Version
  1. 365
Platform
  1. Windows
Good day. I am running Excel out of Office 365 (updated) on Windows 10 Home. I am creating a worksheet to track birthdays. I would like to be able to enter a person's birthdate and then show their age in a separate cell. I have achieved this by formatting the birthdate as a Date, then using a cell to extract the year from that and formatting the cell to Number with no decimal points. Then I extract the year from Today() using another cell with the same Number format. Finally, another cell extracts the difference between the two extracted cells to get the person's age. There must be an easier way to do this. Any help is appreciated.
Thank you,
Dan Wilson...
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,883
Office Version
  1. 365
Platform
  1. Windows
How about
Excel Formula:
=DATEDIF(A2,TODAY(),"Y")
 
Solution

Dan Wilson

Active Member
Joined
Feb 5, 2006
Messages
448
Office Version
  1. 365
Platform
  1. Windows
How about
Excel Formula:
=DATEDIF(A2,TODAY(),"Y")
Good day Fluff. You did it again! Apparently DATEDIF is a new or hidden function as it does not show up in my choice of functions. Had it been there, I would have tried it. Thank you, and this one is closed.
Dan Wilson...
 

jtakw

Well-known Member
Joined
Jun 29, 2014
Messages
6,007
Office Version
  1. 2016
Platform
  1. Windows
Hi,

DATEDIF is a old function dating back to Lotus123

If you want to try a function what would show up in Excel, you can use YEARFRAC:

Excel Formula:
=INT(YEARFRAC(A2,TODAY(),1))
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,883
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

Glad to help & thanks for the feedback.
 

Dan Wilson

Active Member
Joined
Feb 5, 2006
Messages
448
Office Version
  1. 365
Platform
  1. Windows
Hi,

DATEDIF is a old function dating back to Lotus123

If you want to try a function what would show up in Excel, you can use YEARFRAC:

Excel Formula:
=INT(YEARFRAC(A2,TODAY(),1))
Good day jtakw. Thank you for responding. I tried the YEARFRAC, but could not get it to work. The DATEDIF did work.
 

Dan Wilson

Active Member
Joined
Feb 5, 2006
Messages
448
Office Version
  1. 365
Platform
  1. Windows
Glad to help & thanks for the feedback.
Hi Fluff. I was going to ask you to tell me where to find a complete list of Excel Functions, but then I looked in Help and there it was. Thanks again.
Dan Wilson...
 

Watch MrExcel Video

Forum statistics

Threads
1,130,169
Messages
5,640,550
Members
417,151
Latest member
ChickenTenderer

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
Top