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
AndyuxAndyux 

territory formula using state or owner

My inital territory assigment per state works. So Territory (text formula) =
IF(ISBLANK(BillingState), "International",
IF(CONTAINS("WA:OR:CA:AZ:NV:IDMT:WY:UT:CO:NM:TX:OK:KS:NE:WY:NE:SD:ND:MN:IA:MO:AR:LA:WI:IL", BillingState), "USA - West",
IF(CONTAINS("AB:BC:MB:NT:NU:SK:YT", BillingState), "CAN - West",
IF(CONTAINS("MI:IN:KY:TN:MS:AL:GA:FL:SC:NC:VA:WV:PA:PA:NY:ME:ME:VT:NH:MA:RI:CT:NJ:DE:DE:MD", BillingState), "USA - East",
IF(CONTAINS("NB:NL:NS:ON:PE:QC", BillingState), "CAN - East",
 "International")))))
Now I have asked to add an exception based on account owner, but i am not sure how to add this to the formula
IF(CONTAINS("VS:BJ", Owner.Alias), "Legacy",
So if the owner alias contains VS or BJ, then the territory is Legacy, and ignores the BillingState. Thanks!

 
Alain CabonAlain Cabon
Hi,

Just add your new IF expression with the comma at the beginning and a ")" at the end (line 6).

That's all because it is your final value.

IF ( condition , <final value if true> , <final value if false> or <new nested IF> )

Alain 
Akhil AnilAkhil Anil
Hi Andyux,

Your formula should be simply this
 
IF(CONTAINS("VS:BJ", Owner.Alias), "Legacy",
IF(ISBLANK(BillingState), "International",
IF(CONTAINS("WA:OR:CA:AZ:NV:IDMT:WY:UT:CO:NM:TX:OK:KS:NE:WY:NE:SD:ND:MN:IA:MO:AR:LA:WI:IL", BillingState), "USA - West",
IF(CONTAINS("AB:BC:MB:NT:NU:SK:YT", BillingState), "CAN - West",
IF(CONTAINS("MI:IN:KY:TN:MS:AL:GA:FL:SC:NC:VA:WV:PA:PA:NY:ME:ME:VT:NH:MA:RI:CT:NJ:DE:DE:MD", BillingState), "USA - East",
IF(CONTAINS("NB:NL:NS:ON:PE:QC", BillingState), "CAN - East",
"International"))))))

Kindly mark it as an answer if that works !