Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Formula to auto generate age group based on age

  • 29-10-2020 10:21PM
    #1
    Registered Users, Registered Users 2 Posts: 8


    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,992 ✭✭✭✭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: 8 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, Paid Member Posts: 1,713 ✭✭✭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.

    I subscribed to keep boards.ie alive!
    boards.ie: Now Ye're Subscribing



Advertisement