ShowAll Questionssorted byDate Posted
jcald

# 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 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)
)
)
)
)

Vamsi 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
jcald
Great! it works! Thanks.