Forum Discussion
JoelGDucharme
Feb 26, 2024Brass Contributor
Calculate age from a birth day and create age groups
I have a Sharepoint list for registration of a competition grouping participants in different age groups. I would like to program a column that calculates the age of a participant on January 1st 2024 and then select in which age group they are.
The age groups are as follows :
Group 1 : 5-6 yo
Group 2 : 7-8 yo
Group 3 : 9-11 yo
Group 4 : 12-13 yo
Group 5 : 14-18 yo
I'm thinking two calculated columns, one for the age on January 1st and one to show which group they are.
I'm a real newbie with programming columns and I'm lost in the research that I have done.
Thanks for any help you can give me.
- It's so satisfying to find the solution myself! Here is what I found for the grouping column:
=IF(Âge>18,"non",IF(Âge>13,"Groupe 5",IF(Âge>11,"Groupe 4",IF(Âge>8,"Groupe 3",IF(Âge>6,"Groupe 2",IF(Âge>4,"Groupe 1",IF(Âge>0,"non")))))))
It works perfectly!
3 Replies
- JoelGDucharmeBrass ContributorI found this formula
=DATEDIF((1/1/2024),[Date de naissance],"Y")
Where "date de naissance" refers to the DOB column. It calculates, but it isn't calculating correctly. For a DOB of 01/07/2002, it's giving 102 years. I tried inversing the DOB to see if it would work but no. And I also tried 2024/01/01 for the date in the formula to no avail.- JoelGDucharmeBrass ContributorOk. I found a way to make it work for the age. This is the formula
=DATEDIF([Date de naissance],[1e janvier 2024],"Y")
Where [1e janvier 2024] is a column with a default value of January 1st 2024. Since it's a Microsoft Forms that feeds this list, I'm not worried that someone changes this value. And I will hide the column. It works. Now to figure out part 2.- JoelGDucharmeBrass ContributorIt's so satisfying to find the solution myself! Here is what I found for the grouping column:
=IF(Âge>18,"non",IF(Âge>13,"Groupe 5",IF(Âge>11,"Groupe 4",IF(Âge>8,"Groupe 3",IF(Âge>6,"Groupe 2",IF(Âge>4,"Groupe 1",IF(Âge>0,"non")))))))
It works perfectly!