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
LJHOWELJHOWE 

IF(AND FORMULA QUESTION

Code:
Data Type Formula    
IF(AND( Region__c ="REGION 1", Agent_State__c ="MI"),"JOHN DOE",
IF(AND( Region__c ="REGION 1", Agent_State__c ="IN"),"JOHN DOE",)
 I have several different regions with specific agent states to assign to my marketing reps. I'm trying to set up a formula field to look at the region and the agent state and put the name I type in for the marketing rep.  The above formula works, but it becomes too large to run.  I am open to any suggestions on this.  Thanks for any help you can give.
Best Answer chosen by Admin (Salesforce Developers) 
BuellBuell
How many marketing reps do you need to assign in this formula?  Do they cover more than one state?
 
You could do something like:
 
Code:
IF(AND( Region__c ="REGION 1", CONTAINS("MI:IN:OH:WI", Agent_State__c)),"JOHN DOE",
IF(AND( Region__c ="REGION 2", CONTAINS("CA:NV:UT:WA", Agent_State__c)),"JANE DOE",
))

 


Message Edited by Buell on 11-13-2008 04:22 PM

All Answers

BuellBuell
How many marketing reps do you need to assign in this formula?  Do they cover more than one state?
 
You could do something like:
 
Code:
IF(AND( Region__c ="REGION 1", CONTAINS("MI:IN:OH:WI", Agent_State__c)),"JOHN DOE",
IF(AND( Region__c ="REGION 2", CONTAINS("CA:NV:UT:WA", Agent_State__c)),"JANE DOE",
))

 


Message Edited by Buell on 11-13-2008 04:22 PM
This was selected as the best answer
LJHOWELJHOWE
Thanks so much for the assistance - I knew there had to be an easier way to do this.  I had 9 market reps - some were assigned by state and region and some of those same reps by region only.  I combined the formula you gave me above with my old CASE formula I had used for when they were assigned only by regions.  It worked perfectly!!  Thanks, again, Buell for your help!!