Skip to content

Instantly share code, notes, and snippets.

@charltonAthletic
Last active August 29, 2015 14:16
Show Gist options
  • Save charltonAthletic/2367fc61da1aa1110ae0 to your computer and use it in GitHub Desktop.
Save charltonAthletic/2367fc61da1aa1110ae0 to your computer and use it in GitHub Desktop.
// This is a Salesforce formula which uses CASE, ISPICKVAL and boolean conditions.
CASE(Split_Region__c,
"Hong Kong", "Hong Kong",
"Singapore", "Singapore",
"Australia & NZ", "Australia & NZ",
"Japan", "Japan",
"Canada", "Canada",
"Caribbean", "LATAM",
"Latin America", "LATAM",
"Benelux", "Benelux",
"Eastern Europe", "Germany/Austria/Switzerland",
"Germany/Austria/Switzerland", "Germany/Austria/Switzerland",
"France", "France",
"Middle East & Africa", "Middle East & Africa",
"Scandinavia", "Scandinavia",
"Southern Europe", "Southern Europe",
IF(ISPICKVAL(Opportunity.Account.GCM_Account__c, "G14") && Split_Region__c = "United States", "US-GCM",
IF(ISPICKVAL(Opportunity.Account.GCM_Account__c, "FASS") && Split_Region__c = "United States", "US-FASS",
IF(ISPICKVAL( Opportunity.Account.Alliance_Account__c, "HSP") && Split_Region__c = "United States", "US-Alliances",
IF((NOT(ISPICKVAL(Opportunity.Account.GCM_Account__c, "G14")) || NOT(ISPICKVAL(Opportunity.Account.GCM_Account__c, "FASS")))
&&(NOT(ISPICKVAL( Opportunity.Account.Alliance_Account__c, "HSP")) && ISPICKVAL(US_Split__c, "NY/NJ/CT") && Split_Region__c = "United States"), "US-New York Team",
IF((NOT(ISPICKVAL(Opportunity.Account.GCM_Account__c, "G14")) || NOT(ISPICKVAL(Opportunity.Account.GCM_Account__c, "FASS")))
&&(NOT(ISPICKVAL( Opportunity.Account.Alliance_Account__c, "HSP")) && ISPICKVAL(US_Split__c, "East") && Split_Region__c = "United States"), "US-East Coast Team",
IF((NOT(ISPICKVAL(Opportunity.Account.GCM_Account__c, "G14")) || NOT(ISPICKVAL(Opportunity.Account.GCM_Account__c, "FASS")))
&&(NOT(ISPICKVAL( Opportunity.Account.Alliance_Account__c, "HSP")) && ISPICKVAL(US_Split__c, "West") && Split_Region__c = "United States"), "US-West Coast Team",
IF((NOT(ISPICKVAL(Opportunity.Account.GCM_Account__c, "G14")) || NOT(ISPICKVAL(Opportunity.Account.GCM_Account__c, "FASS")))
&&(NOT(ISPICKVAL( Opportunity.Account.Alliance_Account__c, "HSP")) && ISPICKVAL(US_Split__c, "Midwest") && Split_Region__c = "United States"), "MidWest Team",
IF(ISPICKVAL(Opportunity.Account.GCM_Account__c, "G14") && Split_Region__c = "UK & Ireland", "UK-GCM",
IF(ISPICKVAL(Opportunity.Account.GCM_Account__c, "FASS") && Split_Region__c = "UK & Ireland", "UK-FASS",
IF(ISPICKVAL(Opportunity.Account.Alliance_Account__c, "HSP") && Split_Region__c = "UK & Ireland", "UK-Alliances",
IF((NOT(ISPICKVAL(Opportunity.Account.GCM_Account__c, "G14")) || NOT(ISPICKVAL(Opportunity.Account.GCM_Account__c, "FASS")))
&&(NOT(ISPICKVAL( Opportunity.Account.Alliance_Account__c, "HSP")) && ISPICKVAL(Opportunity.Account.Account_Type__c, "Sell-Side") && Split_Region__c = "UK & Ireland"), "UK-Sell Side",
IF((NOT(ISPICKVAL(Opportunity.Account.GCM_Account__c, "G14")) || NOT(ISPICKVAL(Opportunity.Account.GCM_Account__c, "FASS")))
&&(NOT(ISPICKVAL( Opportunity.Account.Alliance_Account__c, "HSP")) && NOT(ISPICKVAL(Opportunity.Account.Account_Type__c, "Sell-Side")) && Split_Region__c = "UK & Ireland"), "UK-Buy Side",
IF(Split_Region__c = "UK & Ireland", "UK & Ireland",
IF(Split_Region__c = "United States", "United States",
"No Match")))))))))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment