Forum Discussion
Nestled IF functions
Hi all, first time poster so apologies if there is something I should have done first!
I have a list of approx 5500 people and their ages and I am trying to get excel to assign them age brackets, but it is only returning results for the first argument or the last one...
My formula is... =IF(B2<20,"17-19",IF(B2>19<25,"20-24",IF(B2>24<30,"25-29",IF(B2>29<35,"30-34",IF(B2>34<40,"35-39",IF(B2>39<45,"40-44",IF(B2>44<50,"45-49",IF(B2>49<55,"50-54",IF(B2>54<60,55-59,"60+")))))))))
At the min, you are either 17-19 or 60+!
What am I missing!?
Hi Paul,
With nested it's like
=IF(B2<20,"17-19",IF(B2<25,"20-24",IF(B2<30,"25-29",IF(B2<35,"30-34",IF(B2<40,"35-39",IF(B2<45,"40-44",IF(B2<50,"45-49",IF(B2<55,"50-54",IF(B2<60,55-59,"60+")))))))))
- Paul MarshCopper Contributor
Thanks Sergei, all sorted!
- Mark GordonCopper Contributor
Is there a way to have nested IF AND and NOT formulas? If so where can I read it? Thank you. ML Gordon
Mark, that is different topic, better if you start new conversation with it. As for the question I didn't catch what do you mean, within nested IF could be combination of any functions https://support.office.com/en-us/article/use-nested-functions-in-a-formula-9d7c966d-6030-4cd6-a052-478d7d844166