Feb 16 2020 12:53 PM
I am trying to group ages in a column in a worksheet. I have tweaked the following formula, but keep getting an error message. I am not sure what I am doing wrong. I am trying to increase my knowledge and do some analytics work, but I have missed something.
This is the formula. Any suggestions?
=IF(ISBLANK(E2),"NULL",IF(E2<2,"Infant"),IF(E2>2<12 ,"Child"),IF(E2>12<18, "Teen"),IF(E2>18,"Adult"))
Feb 17 2020 02:06 AM
Try this formula in S2 on the "titanic3" sheet.
=IF(ISBLANK([@age]),"NULL",IFERROR(IFS([@age]<2,"Infant",[@age]<12,"Child",[@age]<=18,"Teen"),"Adult"))
Feb 17 2020 02:17 AM
As variant
=IF(ISBLANK([@age]),"NULL", LOOKUP([@age],{0,2,12,18},{"Infant","Child","Teen","Adult"}))