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
Vidya IyerVidya Iyer 

IN functionality in SF formula

Hi,

Does SF have a function similar to IN?
In our business, we have split CA into Nothern and Southern CA.We have 2 different reps taking care of these territories.

What I am looking to do is,find if a lead in CA belongs to Nothern or Southern CA.
If a lead belongs to a particular set of cities in CA, it needs to be marked as Nothern CA (this is a checkbox field).
If this field is not checked, then I know it is southern CA.

I tried createing a formula - 

IF ((State="CA"),IF( NOT(ISBLANK(City)),IF( Cty__c="ALAMEDA"||Cty__c="ALBANY"||Cty__c="ALTURAS"||Cty__c="AMADOR"||Cty__c="AMERICAN CANYON"||Cty__c="ANDERSON",TRUE,FALSE), FALSE), FALSE)

This is just a snippet - I have around 50 cities and I get the error that formula length is more than 5000 character.
Is there any other way of doing this?Any help with this is appreciated.

Thanks,
Vidya.
SalesFORCE_enFORCErSalesFORCE_enFORCEr
You can try the CASE formula but if it crosses the character limit then you have to move the logic to a trigger.