To calculate Age_Group from Date_of_Birth, you first need to calculate the current age in years (or months for infants), then use conditional logic to assign the correct range. Here’s a sample logic you can apply in Excel, Google Sheets, or a script (like Apps Script or SQL):
Step 1: Calculate Age
In Excel/Sheets:
=DATEDIF(Date_of_Birth, TODAY(), “Y”)
For infants less than 1 year, calculate in months:
=DATEDIF(Date_of_Birth, TODAY(), “M”)
Step 2: Assign Age_Group using nested IFs
=IF(DATEDIF(A2,TODAY(),“M”)<12, “0-1 Yrs”,
IF(DATEDIF(A2,TODAY(),“Y”)<2, “1-2 Yrs”,
IF(DATEDIF(A2,TODAY(),“Y”)<5, “2-5 Yrs”,
IF(DATEDIF(A2,TODAY(),“Y”)<6, “5-6 Yrs”,
IF(DATEDIF(A2,TODAY(),“Y”)<10, “6-10 Yrs”,
IF(DATEDIF(A2,TODAY(),“Y”)<19, “10-19 Yrs”,
IF(DATEDIF(A2,TODAY(),“Y”)<49, “19-49 Yrs”,
IF(DATEDIF(A2,TODAY(),“Y”)<60, “49-60 Yrs”,
“60+ Yrs”))))))))
Step 3: Use Show_If Logic
Based on the value in Age_Group, apply your form’s conditional logic like:
Show_If(age_Group = “19-49 Yrs”)
Let me know if you’re using a specific platform (Excel, Google Sheets, AppSheet, SQL, etc.) and I can tailor the solution accordingly.