Calculating age on next birthday

Zaigham

Board Regular
Joined
Dec 22, 2010
Messages
159
Office Version
  1. 2021
Platform
  1. Windows
  2. Mobile
Hi
I have a table in which I have to calculate the age on next birthday of an employee at the time of his retirement. I can calculate actual age at the time of retirement but unable to calculate his age on next birthday if his date of retirement is a few days greater than his birthday.
Below mentioned table may be helpful to explain my problem.

Excel Workbook
AB
1Example # 1*
2Date of Birth10.01.1970
3Date of Retirement09.01.2000
4Age on retirement30
5Age on next birthday30
6**
7Example # 2*
8Date of Birth10.01.1970
9Date of Retirement10.01.2000
10Age on retirement30
11Age on next birthday31
Sheet1
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
why not current age and add 1

Please see the example#2 minutely, if date of retirement is before his birthday than OK otherwise +1. I have made this with a lengthy IF() statement but I was thinking that someone could guide me to a better solution.
 
Upvote 0
If you are defining age in the way it's generally understood then in your first example isn't the age on retirement still 29 as the 30th birthday hasn't been reached by that date - I agree with BeingYogi, wouldn't age at next birthday always be the retirement age +1?

You can use DATEDIF

=DATEDIF(B2,B3,"y")

and

=DATEDIF(B2,B3,"y")+1
 
Upvote 0
Hi barry houdini
You are absolutely right 30th birthday hasn't been reached by that date but his age is 30 years =YEAR(B3)-YEAR(B2). From the date of his 30th birthday he will start his 31st year of age. So if his date of retirement falls before his 30th birthday his age will be calculated 30 years. In other case if his date of retirement is equal to or greater than his 30th birthday than we have to tell his age on next birthday i.e., 31st birthday obviously he will be 31 years old on that date.
I have got it with =IF(B3>=DATE(YEAR(B2)+B4,MONTH(B2),DAY(B2)),B4+1,B4)
Any suggestions please.
 
Upvote 0
I'm not sure I understand that. Is this a specific condition for 30 years or does it apply anywhere?

I don't think that =YEAR(B3)-YEAR(B2) is a particularly good way to calculate age. If B2 is 1st Jan 2000 and B3 is 31st Dec 2001 that calculation will give you 1 for a time gap of 629 days, if B2 is 31st Dec 2004 and B3 is the day after, 1st Jan 2005, then that's a 1 day time gap but that formula will still give you 1
 
Upvote 0
Hi barry houdini

30 years is just an example it may be 31 or 45 or any age at the time of retirement. However, your suggested "=DATEDIF(B2,B3,"y")+1" is one simple command which I required. It gives me required age i.e., age on birthday falling after the date of retirement. In my actual form I was using a very lengthy formula with multiple sleeves of IF() OR() AND() and DATE() statements.

Thank you very much.

Regards
Zaigham
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,849
Members
452,948
Latest member
UsmanAli786

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