Forum Discussion

Harry_I's avatar
Harry_I
Copper Contributor
Jan 06, 2022

IF function with AND

Why is: IF(AND(Z5>4,5,Z5<9,5);1;"") wrong?

3 Replies

    • Harry_I's avatar
      Harry_I
      Copper Contributor
      Same result. I changed the logical test with an integer for easier reading.
      =IF(AND(Z5>4,Z5<9),1,"")
      The error code is:
      "There's a problem with this formula.
      Not trying to type a formula?
      When the first character is an equal ("=") or minus ("-") sign, Excel thinks it's a formula:
      • you type: =1+1, cell shows: 2
      To get around this, type an apostrophe ( ' ) first:
      • you type: '=1+1, cell shows: =1+1"
      • Harry_I's avatar
        Harry_I
        Copper Contributor
        This solved it: =IF(AND(Z5>4;Z5<10);1;"")

        Thanks for your response!

Resources