0

I am using Excel 2010 and I want to use an IF statement with 3 conditions, but I am having some problems. Here is my condition, I can't use the comma sign because in Excel 2010, it apparently doesn't work. Am I messing up the syntax, or is the approach incorrect?

=IF(AND(AJ8<4,2);"Apple" = IF(AND(AJ8>4,1 AND(AJ8<8);"Cherry" =IF(AJ8>8,5);"Pinneaple");

2 Answers 2

2

If Excel does not like commas, that is not a problem of Excel 2010, but due to your regional settings. Most non-English European languages use the semicolon where UK and US uses the comma. When you source formulas from international forums, you may need to adjust the formulas before you can use them in your spreadsheet.

The AND() function has the syntax

AND(*condition1*,*condition2*,[optional condition n])

Each condition will contain a comparison operator like

  • = (equal),
  • <> (not equal),
  • < (Less than),
  • > (greater than),
  • <= (less than or equal),
  • >= (greater than or equal),

A formula starts with a = sign, but when you nest several functions inside of each other, you do not need to precede the functions with another = sign. In fact that will result in errors.

You don't need a semicolon at the end of a formula. That's JavaScript or CSS, not Excel.

So, if we can assume that your regional settings use a comma as the decimal delimiter and the semicolon as the list delimiter, then what you need is probably

=IF(AJ8<4,2;"Apple";IF(AND(AJ8>4,1;AJ8<8);"Cherry";IF(AJ8>8,5;"Pineapple";"the value is between 8 and 8,5")))

A system with decimal point and comma as list delimiter would use

=IF(AJ8<4.2,"Apple",IF(AND(AJ8>4.1, AJ8<8),"Cherry",IF(AJ8>8.5,"Pineapple","the value is between 8 and 8.5")))
2
  • I understand where I was wrong, I learned a lot from your answers. Thank you very much :) Jun 11, 2015 at 9:26
  • Thanks for the feedback. Please mark my post as the answer, so others can find it more easily.
    – teylyn
    Jun 11, 2015 at 9:27
1

There is an error with the AND functions and the semicolons. This should work

IF(B1<4,2;"Apple";IF(AND(B1>4,1;B1<8);"Cherry";IF(B1>8,5;"Pineapple";"NULL")))

You must log in to answer this question.

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