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
Daniel BlevinsDaniel Blevins 

IF / Case Statment logic

So this formula needs to Put down if a customer is an A,B, or C customer ranking depending on if the Annual Support field (which is a currency) is between these ranges, but we have two different kinds of structure depending on product. So the first IF is the split there, our JustWare customers have a ranking, and everything else falls into the other catagory, so IF product = Justware  TRUE first section ranking, False second ranking.  Right now it hates the formula and I was wondering if im missing a golden oppetunity to make this into a simpler CASE statement.

IF(Product__c = 'JustWare',
  IF(Annual_Support__c >=100000, 'A',
    IF(AND(Annual_Support__c<100000, Annual_Support__c >=50000), 'B',
     IF(Annual_Support__c>50000, 'C',
         )
       )
     ),
  IF(Annual_Support__c>=200000, 'A',
     IF(AND( Annual_Support__c<200000, Annual_Support__c >=80000), 'B',
        IF(Annual_Support__c>80000, 'C'
    )
   )
  )
)
Best Answer chosen by Daniel Blevins
Daniel BlevinsDaniel Blevins

Got this from from Steve Molis because he is amazing at what he does 

Data TypeFormula  
IF(INCLUDES(Product__c,'JustWare'), 
IF(Annual_Support__c >=100000, 'A', 
IF(Annual_Support__c >=50000, 'B', 
'C')), 
IF(Annual_Support__c >= 200000, 'A', 
IF(Annual_Support__c >=80000, 'B', 
'C')) 
)

All Answers

Daniel BlevinsDaniel Blevins

This is what I would like but it really doesn't like it.

IF(Product__c="JustWare",
CASE(Annual_Support__c,
Annual_Support__c >=100000, 'A',
Annual_Support__c<100000, && >=50000, 'B',
Annual_Support__c>50000, 'C',
NULL),
CASE(Annual_Support__c,
Annual_Support__c >=200000, 'A',
Annual_Support__c<200000, && >=80000, 'B',
Annual_Support__c>80000, 'C',
NULL)

Shawn Reichner 29Shawn Reichner 29
Can you try this....
OR(
IF(
AND(
Product__c = 'JustWare',
Annual_Support__c >=100000),'A',
IF(
AND(
Product__c='JustWare',
Annual_Support__c<100000 && Annual_Support__c>=50000),'B',
IF(
AND(
Product__c='JustWare',
Annual_Support__c>50000),'C',
IF(
AND(
Product__c!='JustWare',
Annual_Support__c >=200000),'A',
IF(
AND(
Product__c!='JustWare',
Annual_Support__c <200000 && Annual_Support__c>=80000),'B',
IF(
AND(
Product__c!='JustWare',
Annual_Support__c >80000),'C',
Null))))))
)
Daniel BlevinsDaniel Blevins

Got this from from Steve Molis because he is amazing at what he does 

Data TypeFormula  
IF(INCLUDES(Product__c,'JustWare'), 
IF(Annual_Support__c >=100000, 'A', 
IF(Annual_Support__c >=50000, 'B', 
'C')), 
IF(Annual_Support__c >= 200000, 'A', 
IF(Annual_Support__c >=80000, 'B', 
'C')) 
)

This was selected as the best answer