Forum Discussion
jinibob
Aug 07, 2022Copper Contributor
Lists Formulas For Calculate Age From Date of Birth
Hi, In the below list I have a column labeled 'DoB (Date of Birth)' and another column labeled 'Age". How do I make the calculated age based on the date of birth automatically populate the 'age' ...
Aug 07, 2022
jinibob You can do this with JSON column formatting. I tested this solution by RobElliott and it worked perfectly. Date calculation on SharePoint lists between today and a birthdate - Microsoft Tech Community
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "=floor((Number(@now)-Number([$DoB]))/(1000*60*60*24*12)/365*12)"
}
jinibob
Aug 09, 2022Copper Contributor
Hi,
Thanks for the info. Where do I need to paste the above code that you have kindly provided?
Thanks
Thanks for the info. Where do I need to paste the above code that you have kindly provided?
Thanks