function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jcaldjcald 

IF statement (range)

Can someone tell me what I am doing wrong in this formula?

IF(Finance_Amount__c <3000, "Range$0-$3000",
  IF(Finance_Amount__c >3000, "Range$3000-$9000",
    IF(Finance_Amount__c >9000, "Range$9000-$12000",
      IF(Finance_Amount__c >12000, "Range$12000-$14000", NULL
)
)
)
)

Only the top two statements validates, when the amount is entered.

Thanks
Best Answer chosen by jcald
Vamsi KrishnaVamsi Krishna
any number greater than 9000, 12000 is obviously greater than 3000.. so it will only execute the first match it finds which is > 3000..
to solve this just reverse the order

IF(Finance_Amount__c >14000, NULL,
IF(Finance_Amount__c >12000, "Range$12000-$14000",
IF(Finance_Amount__c >9000, "Range$9000-$12000",
IF(Finance_Amount__c >3000, "Range$3000-$9000",
IF(Finance_Amount__c >0, "Range$0-$3000", NULL)
)
)
)
)

All Answers

Vamsi KrishnaVamsi Krishna
any number greater than 9000, 12000 is obviously greater than 3000.. so it will only execute the first match it finds which is > 3000..
to solve this just reverse the order

IF(Finance_Amount__c >14000, NULL,
IF(Finance_Amount__c >12000, "Range$12000-$14000",
IF(Finance_Amount__c >9000, "Range$9000-$12000",
IF(Finance_Amount__c >3000, "Range$3000-$9000",
IF(Finance_Amount__c >0, "Range$0-$3000", NULL)
)
)
)
)
This was selected as the best answer
jcaldjcald
Great! it works! Thanks.