Archive for May, 2008

Custom Formula: Specify Account Time Zone [Salesforce.com]

If you have a list of accounts to call, it’s useful to sort them by time zone so you know which accounts need to be called first/last.

The following custom formula field assigns a time zone based on the state or province. For states/provinces in multiple time zones, it assigns the time zone of the majority of that region. (In other words, it may be off by an hour in some places, but it does the trick.)

(If you have trouble reading the code, here’s a plain text version.)


IF(LEN( BillingState)=0, “None”,
IF(CONTAINS(”CT:DC:DE:FL:GA:IN:ME:MD:MA:MI:NH:NJ:NY:NC:OH:PA:RI:SC:VT:VA:WV:ON:QC:NB:NS:NL:PE”, BillingState), “GMT-5 Eastern”,
IF(CONTAINS(”AL:AR:IL:IA:KS:KY:LA:MN:MS:MO:NE:ND:OK:SD:TN:TX:WI:SK:MB:NU”, BillingState), “GMT-6 Central”,
IF(CONTAINS(”AZ:CO:ID:MT:NM:UT:WY:AB:NT”, BillingState), “GMT-7 Mountain”,
IF(CONTAINS(”AK”, BillingState), “GMT-9 Alaska”,
IF(CONTAINS(”HI”, BillingState), “GMT-10 Hawaii”,
IF(CONTAINS(”CA:NV:OR:WA:BC:YT”, BillingState), “GMT-8 Pacific”, “Other”)))))))