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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Formula to auto generate age group based on age

  • 29-10-2020 10:21pm
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 Posts: 25,620 ✭✭✭✭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, Registered Users 2 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, Registered Users 2 Posts: 1,704 ✭✭✭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