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...
- Feb 26, 2024It'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!
JoelGDucharme
Feb 26, 2024Brass Contributor
I 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.
=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.
- JoelGDucharmeFeb 26, 2024Brass 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.- JoelGDucharmeFeb 26, 2024Brass 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!