1

IF(F2<18.5,”UNDERWEIGHT”, IF(F2>25<30, “OVERWEIGHT”, IF(F2>30,”OBESE”, IF(F2<24.9>18.5,”NORMAL”))))

I don’t know what I’m doing wrong. Cell F2 is a simple Number and i want the cell to say if that number is categorized as someone underweight,overweight,obese or normal.

After I input the formula a red triangle with an exclamation mark appears and says “you can’t compre a Boolean with a number because their data types are different.”

I also don’t know if it needs space between each IF or not.

2 Answers 2

1

I have found the problem. I have to use IF(F2<18.5,”UNDERWEIGHT”, IF ( F2<24.9,”NORMAL”, IF (F2<29.9,”Overweight”, IF(F2>30,”OBESE”))))

2
  • 1
    That's even better :-)
    – nohillside
    Commented Jun 26, 2021 at 9:09
  • One reason it is better is that it deals with every number e.g. what would 24.95 have been in the original
    – mmmmmm
    Commented Jun 26, 2021 at 9:10
1

You can‘t compare several values at once. So instead of

F2>25<30

use

AND(F2>25,F2<30)

(Same for the similar IF a bit later on).

So the whole line will look like

IF(F2<18.5,”UNDERWEIGHT”, IF(AND(F2>25,F2<30), “OVERWEIGHT”, IF(F2>30,”OBESE”, IF(AND(F2<24.9, F2>18.5),”NORMAL”))))

3
  • Can I use to functions in one cell? I’m sorry, how can I apply that into the whole formula? 🤔 Commented Jun 25, 2021 at 23:08
  • @VanessaLopez Just replace the relevant part within your formula with the AND() part.
    – nohillside
    Commented Jun 25, 2021 at 23:09
  • I have found the issue. Thank you for helping, I actually had to use this formula IF(F2<18.5,”UNDERWEIGHT”, IF ( F2<24.9,”NORMAL”, IF (F2<29.9,”Overweight”, IF(F2>30,”OBESE”)))) Commented Jun 25, 2021 at 23:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .