3 Replies Latest reply on Apr 1, 2013 9:21 AM by philmodjunk

    Nested if calculation problem

    zaza

      Title

      Nested if calculation problem

      Post

           I am trying to set up text formatting colour change to specified values but i keep getting 'too many parameters' error.

           the formula so far is:

      If ( curr_property  ≥ 360 and 600 ; TextColor ( curr_property ; RGB ( 255 ; 153 ; 204 ; If ( curr_property  ≥ 600 and  ≤ 999 ; TextColor ( curr_property ; RGB ( 255 ; 204 ; 0  ; If ( curr_property  ≥ 1000 ; TextColor ( curr_property ; RGB ( 221 ; 8 ; 6  ; curr_property ) ) 

           Have I used the wrong operators, too many brackets?

           Any help will be appreciated.

        • 1. Re: Nested if calculation problem
          JimMac

               the AND is  used like this...

          curr_property  ≥ 360 and 600 

          curr_property ≥ 360  and  curr_property ≥ 600

               But this means that all True must be ≥ 600

          Not sure if you mean that but each logical must be independently testedwink

          JIm...

          • 2. Re: Nested if calculation problem
            JimMac

                 I am guessing at your intent....

                 If ( curr_property  ≥ 360 and curr_property < 600 ; TextColor ( curr_property ; RGB ( 255 ; 153 ; 204 ; If ( curr_property  ≥ 600 and  curr_property ≤ 999 ; TextColor ( curr_property ; RGB ( 255 ; 204 ; 0  ; If ( curr_property  ≥ 1000 ; TextColor ( curr_property ; RGB ( 221 ; 8 ; 6  ; curr_property ) ) 

            • 3. Re: Nested if calculation problem
              philmodjunk

                   And please take a look at using Case instead of If. It can often produce much simpler expressions to produce the same results than  when you nest if funcitions.