Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Formula to auto generate age group based on age

Options
  • 29-10-2020 11:21pm
    #1
    Registered Users Posts: 2


    Not great at Excel as I am only learning but I have a list of patients, their DOB and their age which generated by formula based on DOB.

    I want to create a formula that will select a pre-determined age group based on the age.
    The age groups are as follows 0 - 4, 5 - 17, 18 - 64, 65+


    Be grateful for any help.
    Tagged:


Comments

  • Registered Users Posts: 25,441 ✭✭✭✭coylemj


    Substitute the cell address or field name containing the age for 'age' below......

    =if(age<5,"0-4",if(age<18,"5-17",if(age<65,"18-64","65+")))


  • Registered Users Posts: 2 carenmc


    Thanks, only issue is that it doesn't account for cells with no DOB in it and returns a value of 65+ meaning my figures will be out.


  • Registered Users Posts: 1,703 ✭✭✭JoyPad


    carenmc wrote: »
    Thanks, only issue is that it doesn't account for cells with no DOB in it and returns a value of 65+ meaning my figures will be out.

    You can add a check for non-null value:

    =if(isblank(age),"Unknown", if(...))

    The if(...) is meant to be the existing condition from coylemj.


Advertisement