Age/Date Formula

bpgolferguy

Active Member
Joined
Mar 1, 2009
Messages
469
Hi, I'm trying to come up with a way to make a "Class of" calculation....you know, like class of 2011, etc? What I'm thinking in my head, and it seems right, is if I have the birthday in A1, then the date they turn 18 in cell A2.....have the formula look at that date (only the month and day) in A2 and if it's before (prior) to 6/1 then use the year (yyyy format) from A2 and input it into A3 as my value. However, if the date in A2 is AFTER 6/1, then I want to add 1 year to the date in A2 and input that year (yyyy) into A3.

The reason I use 6/1 is because that's the official "start" date of my organization each year, so depending on which side of it the birthday falls will determine "Class of" date.

Thanks in advance for the help!
 
does this work

Excel Workbook
A
17/3/1972
27/3/1990
31991
Sheet1
Excel 2003
Cell Formulas
RangeFormula
A2=TEXT(MONTH(A1)&"/"&DAY(A1)&"/"&YEAR(A1)+18,"mm/dd/yyyy")+0
A3=IF(TEXT(MONTH(A2)&"/"&DAY(A2),"mm/dd")<="06/01",YEAR(A2),YEAR(EDATE(A2,12)))

Perfect!!!! Thank you thank you thank you!!!!
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
does this work

Excel Workbook
A
17/3/1972
27/3/1990
31991
Sheet1
Excel 2003
Cell Formulas
RangeFormula
A2=TEXT(MONTH(A1)&"/"&DAY(A1)&"/"&YEAR(A1)+18,"mm/dd/yyyy")+0
A3=IF(TEXT(MONTH(A2)&"/"&DAY(A2),"mm/dd")<="06/01",YEAR(A2),YEAR(EDATE(A2,12)))

This worked great! Is there anyway you can make it so that if the A2 is blank then it does nothing in A3? Right now it puts 1900 in there. I would just like it to be blank. Thanks!
 
Upvote 0
Code:
=IF(A2="","",IF(TEXT(MONTH(A2)&"/"&DAY(A2),"mm/dd")<="06/01",YEAR(A2),YEAR(EDATE(A2,12))))
 
Upvote 0
Excel Workbook
A
17/3/1972
27/3/1990
31991
Test
Excel 2003
Cell Formulas
RangeFormula
A2=IF(A1<>"",TEXT(MONTH(A1)&"/"&DAY(A1)&"/"&YEAR(A1)+18,"mm/dd/yyyy")+0,"")
A3=IF(A2="","",IF(TEXT(MONTH(A2)&"/"&DAY(A2),"mm/dd")<="06/01",YEAR(A2),YEAR(EDATE(A2,12))))
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,738
Members
452,940
Latest member
Lawrenceiow

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