Err 509 calc with IF command

cecel-27 -  
brucine Posted messages 24779 Registration date   Status Member Last intervention   -

Hello,

I'm trying to create an IF statement in Calc, but I keep getting an error 509 and can't find it.

Here is my formula:

=IF(AND(B5>=1;B5<=40000);"C19";"0");IF(AND(B5>=40001;B5<=70000);"C20";"0")

1 answer

  1. cecel-27
     

    Finally I found it, if it can help, my correction :

    =IF(AND(B5>=1,B5<=40000),C19,IF(AND(B5>=40001,B5<=70000),C20))

    0
    1. brucine Posted messages 24779 Registration date   Status Member Last intervention   4 161
       

      Hello,

      your thing still doesn't hold up: you understood well that 0 could not replace the second condition, but this one only has two arguments.

      There is still a 0 or whatever you want missing after C20 if none of the ranges are filled.

      0
      1. brucine Posted messages 24779 Registration date   Status Member Last intervention   4 161 > brucine Posted messages 24779 Registration date   Status Member Last intervention  
         

        The thing is, it's not very elegant.

        We don't know what the role of 1 is; it makes sense if B5 can be 0.5 or -4, but not if it's just to check that this cell indeed has a numeric content that is always at least equal to 1.

        Even assuming the "validity" of this condition, if B5 is not <= 40000, it must be greater than it; there is no sense in testing twice:

        =IF(B5>=1,IF(B5<=40000,C19,IF(B5<=70000,C20,0)),0)

        0