+ Start a Discussion
Matthew10Matthew10 

Syntax Error in Formula

Continuously getting a "Syntax Error" on this formula in Process Builder.  Not currently hitting any limits that I can see.  Formula editor states I'm missing an '=', but can't find where that would be.  Have a very similar formula that works.  

Bad formula:

  OR(
   AND([Contact].MailingState = 'ME'), 
   AND([Contact].MailingState = 'Maine'),
   AND([Contact].MailingState = 'IA'),
   AND([Contact].MailingState = 'Iowa'),
   AND([Contact].MailingState = 'IL'),
   AND([Contact].MailingState = 'Illinois'),
   AND([Contact].MailingState = 'MN'),
   AND([Contact].MailingState = 'Minnesota'),
   AND([Contact].MailingPostalCode = '55334'),
   AND([Contact].MailingPostalCode = '55352'),
   AND([Contact].MailingPostalCode = '55354'),
   AND([Contact].MailingPostalCode = '55704'),
   AND([Contact].MailingPostalCode = '55712'),
   AND([Contact].MailingPostalCode = '55749'),
   AND([Contact].MailingPostalCode = '55756'),
   AND([Contact].MailingPostalCode = '56055'),
   AND([Contact].MailingPostalCode = '56074'),
   AND([Contact].MailingPostalCode = '56082'),
   AND([Contact].MailingPostalCode = '56363'),
   AND(VALUE([Contact].MailingPostalCode) >= 55001,VALUE([Contact].MailingPostalCode) <= 55036),
   AND(VALUE([Contact].MailingPostalCode) >= 55038,VALUE([Contact].MailingPostalCode) <= 55309),
   AND(VALUE([Contact].MailingPostalCode) >= 55311,VALUE([Contact].MailingPostalCode) <= 55313),
   AND(VALUE([Contact].MailingPostalCode) >= 55315,VALUE([Contact].MailingPostalCode) <= 55323),
   AND(VALUE([Contact].MailingPostalCode) >= 55325,VALUE([Contact].MailingPostalCode) <= 55328),
   AND(VALUE([Contact].MailingPostalCode) >= 55330,VALUE([Contact].MailingPostalCode) <= 55331),
   AND(VALUE([Contact].MailingPostalCode) >= 55336,VALUE([Contact].MailingPostalCode) <= 55341),
   AND(VALUE([Contact].MailingPostalCode) >= 55343,VALUE([Contact].MailingPostalCode) <= 55349),
   AND(VALUE([Contact].MailingPostalCode) >= 55356,VALUE([Contact].MailingPostalCode) <= 55384),
   AND(VALUE([Contact].MailingPostalCode) >= 55386,VALUE([Contact].MailingPostalCode) <= 55388),
   AND(VALUE([Contact].MailingPostalCode) >= 55390,VALUE([Contact].MailingPostalCode) <= 55599),
   AND(VALUE([Contact].MailingPostalCode) >= 55901,VALUE([Contact].MailingPostalCode) <= 56017),
   AND(VALUE([Contact].MailingPostalCode) >= 56020,VALUE([Contact].MailingPostalCode) <= 56021),
   AND(VALUE([Contact].MailingPostalCode) >= 56023,VALUE([Contact].MailingPostalCode) <= 56029),
   AND(VALUE([Contact].MailingPostalCode) >= 56032,VALUE([Contact].MailingPostalCode) <= 56039),
   AND(VALUE([Contact].MailingPostalCode) >= 56042,VALUE([Contact].MailingPostalCode) <= 56052),
   AND(VALUE([Contact].MailingPostalCode) >= 56057,VALUE([Contact].MailingPostalCode) <= 56058),
   AND(VALUE([Contact].MailingPostalCode) >= 56063,VALUE([Contact].MailingPostalCode) <= 56072),
   AND(VALUE([Contact].MailingPostalCode) >= 56078,VALUE([Contact].MailingPostalCode) <= 56080),
   AND(VALUE([Contact].MailingPostalCode) >= 56089,VALUE([Contact].MailingPostalCode) <= 56098)
​  )

Good Formula:

  OR(
   AND([Contact].MailingState = 'ND'), 
   AND([Contact].MailingState = 'North Dakota'),
   AND([Contact].MailingState = 'UT'),
   AND([Contact].MailingState = 'Utah'),
   AND([Contact].MailingState = 'CO'),
   AND([Contact].MailingState = 'Colorado'),
   AND([Contact].MailingState = 'MN'),
   AND([Contact].MailingState = 'Minnesota'),
   AND([Contact].MailingPostalCode = '55037'),
   AND([Contact].MailingPostalCode = '55310'),
   AND([Contact].MailingPostalCode = '55314'),
   AND([Contact].MailingPostalCode = '55324'),
   AND([Contact].MailingPostalCode = '55329'),
   AND([Contact].MailingPostalCode = '55335'),
   AND([Contact].MailingPostalCode = '55342'),
   AND([Contact].MailingPostalCode = '55350'),
   AND([Contact].MailingPostalCode = '55353'),
   AND([Contact].MailingPostalCode = '55355'),
   AND([Contact].MailingPostalCode = '55385'),
   AND([Contact].MailingPostalCode = '55389'),
   AND([Contact].MailingPostalCode = '56019'),
   AND([Contact].MailingPostalCode = '56022'),
   AND([Contact].MailingPostalCode = '56041'),
   AND([Contact].MailingPostalCode = '56054'),
   AND([Contact].MailingPostalCode = '56056'),
   AND([Contact].MailingPostalCode = '56060'),
   AND([Contact].MailingPostalCode = '56062'),
   AND([Contact].MailingPostalCode = '56073'),
   AND([Contact].MailingPostalCode = '56075'),
   AND([Contact].MailingPostalCode = '56081'),
   AND(VALUE([Contact].MailingPostalCode) >= 55332,VALUE([Contact].MailingPostalCode) <= 55333),
   AND(VALUE([Contact].MailingPostalCode) >= 55601,VALUE([Contact].MailingPostalCode) <= 55703),
   AND(VALUE([Contact].MailingPostalCode) >= 55705,VALUE([Contact].MailingPostalCode) <= 55711),
   AND(VALUE([Contact].MailingPostalCode) >= 55713,VALUE([Contact].MailingPostalCode) <= 55748),
   AND(VALUE([Contact].MailingPostalCode) >= 55750,VALUE([Contact].MailingPostalCode) <= 55753),
   AND(VALUE([Contact].MailingPostalCode) >= 55757,VALUE([Contact].MailingPostalCode) <= 55816),
   AND(VALUE([Contact].MailingPostalCode) >= 56083,VALUE([Contact].MailingPostalCode) <= 56088),
   AND(VALUE([Contact].MailingPostalCode) >= 56101,VALUE([Contact].MailingPostalCode) <= 56362),
   AND(VALUE([Contact].MailingPostalCode) >= 56364,VALUE([Contact].MailingPostalCode) <= 58207)
  )
 
Best Answer chosen by Matthew10
Gururaj BGururaj B
Better Try from this:
OR(   AND([Contact].MailingState = 'ME'),    AND([Contact].MailingState = 'Maine'),   AND([Contact].MailingState = 'IA'),   AND([Contact].MailingState = 'Iowa'),   AND([Contact].MailingState = 'IL'),   AND([Contact].MailingState = 'Illinois'),   AND([Contact].MailingState = 'MN'),   AND([Contact].MailingState = 'Minnesota'),   AND([Contact].MailingPostalCode = '55334'),   AND([Contact].MailingPostalCode = '55352'),   AND([Contact].MailingPostalCode = '55354'),   AND([Contact].MailingPostalCode = '55704'),   AND([Contact].MailingPostalCode = '55712'),   AND([Contact].MailingPostalCode = '55749'),   AND([Contact].MailingPostalCode = '55756'),   AND([Contact].MailingPostalCode = '56055'),   AND([Contact].MailingPostalCode = '56074'),   AND([Contact].MailingPostalCode = '56082'),   AND([Contact].MailingPostalCode = '56363'),   AND(VALUE([Contact].MailingPostalCode) >= 55001,VALUE([Contact].MailingPostalCode) <= 55036),   AND(VALUE([Contact].MailingPostalCode) >= 55038,VALUE([Contact].MailingPostalCode) <= 55309),   AND(VALUE([Contact].MailingPostalCode) >= 55311,VALUE([Contact].MailingPostalCode) <= 55313),   AND(VALUE([Contact].MailingPostalCode) >= 55315,VALUE([Contact].MailingPostalCode) <= 55323),   AND(VALUE([Contact].MailingPostalCode) >= 55325,VALUE([Contact].MailingPostalCode) <= 55328),   AND(VALUE([Contact].MailingPostalCode) >= 55330,VALUE([Contact].MailingPostalCode) <= 55331),   AND(VALUE([Contact].MailingPostalCode) >= 55336,VALUE([Contact].MailingPostalCode) <= 55341),   AND(VALUE([Contact].MailingPostalCode) >= 55343,VALUE([Contact].MailingPostalCode) <= 55349),   AND(VALUE([Contact].MailingPostalCode) >= 55356,VALUE([Contact].MailingPostalCode) <= 55384),   AND(VALUE([Contact].MailingPostalCode) >= 55386,VALUE([Contact].MailingPostalCode) <= 55388),   AND(VALUE([Contact].MailingPostalCode) >= 55390,VALUE([Contact].MailingPostalCode) <= 55599),   AND(VALUE([Contact].MailingPostalCode) >= 55901,VALUE([Contact].MailingPostalCode) <= 56017),   AND(VALUE([Contact].MailingPostalCode) >= 56020,VALUE([Contact].MailingPostalCode) <= 56021),   AND(VALUE([Contact].MailingPostalCode) >= 56023,VALUE([Contact].MailingPostalCode) <= 56029),   AND(VALUE([Contact].MailingPostalCode) >= 56032,VALUE([Contact].MailingPostalCode) <= 56039),   AND(VALUE([Contact].MailingPostalCode) >= 56042,VALUE([Contact].MailingPostalCode) <= 56052),   AND(VALUE([Contact].MailingPostalCode) >= 56057,VALUE([Contact].MailingPostalCode) <= 56058),   AND(VALUE([Contact].MailingPostalCode) >= 56063,VALUE([Contact].MailingPostalCode) <= 56072),   AND(VALUE([Contact].MailingPostalCode) >= 56078,VALUE([Contact].MailingPostalCode) <= 56080),AND(VALUE([Contact].MailingPostalCode) >=56089,VALUE([Contact].MailingPostalCode) <= 56098))

All Answers

Gururaj BGururaj B
I think you have put unnecessary AND for few conditions. Try this. If it works please mark as best answer.

OR(
   ([Contact].MailingState = 'ME'), 
   ([Contact].MailingState = 'Maine'),
   ([Contact].MailingState = 'IA'),
   ([Contact].MailingState = 'Iowa'),
   ([Contact].MailingState = 'IL'),
   ([Contact].MailingState = 'Illinois'),
   ([Contact].MailingState = 'MN'),
   ([Contact].MailingState = 'Minnesota'),
   ([Contact].MailingPostalCode = '55334'),
   ([Contact].MailingPostalCode = '55352'),
   ([Contact].MailingPostalCode = '55354'),
   ([Contact].MailingPostalCode = '55704'),
   ([Contact].MailingPostalCode = '55712'),
   ([Contact].MailingPostalCode = '55749'),
   ([Contact].MailingPostalCode = '55756'),
   ([Contact].MailingPostalCode = '56055'),
   ([Contact].MailingPostalCode = '56074'),
   ([Contact].MailingPostalCode = '56082'),
   ([Contact].MailingPostalCode = '56363'),
   AND(VALUE([Contact].MailingPostalCode) >= 55001,VALUE([Contact].MailingPostalCode) <= 55036),
   AND(VALUE([Contact].MailingPostalCode) >= 55038,VALUE([Contact].MailingPostalCode) <= 55309),
   AND(VALUE([Contact].MailingPostalCode) >= 55311,VALUE([Contact].MailingPostalCode) <= 55313),
   AND(VALUE([Contact].MailingPostalCode) >= 55315,VALUE([Contact].MailingPostalCode) <= 55323),
   AND(VALUE([Contact].MailingPostalCode) >= 55325,VALUE([Contact].MailingPostalCode) <= 55328),
   AND(VALUE([Contact].MailingPostalCode) >= 55330,VALUE([Contact].MailingPostalCode) <= 55331),
   AND(VALUE([Contact].MailingPostalCode) >= 55336,VALUE([Contact].MailingPostalCode) <= 55341),
   AND(VALUE([Contact].MailingPostalCode) >= 55343,VALUE([Contact].MailingPostalCode) <= 55349),
   AND(VALUE([Contact].MailingPostalCode) >= 55356,VALUE([Contact].MailingPostalCode) <= 55384),
   AND(VALUE([Contact].MailingPostalCode) >= 55386,VALUE([Contact].MailingPostalCode) <= 55388),
   AND(VALUE([Contact].MailingPostalCode) >= 55390,VALUE([Contact].MailingPostalCode) <= 55599),
   AND(VALUE([Contact].MailingPostalCode) >= 55901,VALUE([Contact].MailingPostalCode) <= 56017),
   AND(VALUE([Contact].MailingPostalCode) >= 56020,VALUE([Contact].MailingPostalCode) <= 56021),
   AND(VALUE([Contact].MailingPostalCode) >= 56023,VALUE([Contact].MailingPostalCode) <= 56029),
   AND(VALUE([Contact].MailingPostalCode) >= 56032,VALUE([Contact].MailingPostalCode) <= 56039),
   AND(VALUE([Contact].MailingPostalCode) >= 56042,VALUE([Contact].MailingPostalCode) <= 56052),
   AND(VALUE([Contact].MailingPostalCode) >= 56057,VALUE([Contact].MailingPostalCode) <= 56058),
   AND(VALUE([Contact].MailingPostalCode) >= 56063,VALUE([Contact].MailingPostalCode) <= 56072),
   AND(VALUE([Contact].MailingPostalCode) >= 56078,VALUE([Contact].MailingPostalCode) <= 56080),
   AND(VALUE([Contact].MailingPostalCode) >= 56089,VALUE([Contact].MailingPostalCode) <= 56098)
​  )
Matthew10Matthew10
Hi Gururaj.  I have tried that and unfortuntely it does not work either.  
Matthew10Matthew10
I have tried that and unfortunately it did not work. 
Gururaj BGururaj B
It could be some weird invisible special character that is causing this issue. So try it in one single line as below:

OR( AND([Contact].MailingState = 'ME'),AND([Contact].MailingState = 'Maine'), AND([Contact].MailingState = 'IA'), AND([Contact].MailingState = 'Iowa'), AND([Contact].MailingState = 'IL'), AND([Contact].MailingState = 'Illinois'), AND([Contact].MailingState = 'MN'), AND([Contact].MailingState = 'Minnesota'), AND([Contact].MailingPostalCode = '55334'), AND([Contact].MailingPostalCode = '55352'), AND([Contact].MailingPostalCode = '55354'), AND([Contact].MailingPostalCode = '55704'), AND([Contact].MailingPostalCode = '55712'), AND([Contact].MailingPostalCode = '55749'), AND([Contact].MailingPostalCode = '55756'), AND([Contact].MailingPostalCode = '56055'), AND([Contact].MailingPostalCode = '56074'), AND([Contact].MailingPostalCode = '56082'), AND([Contact].MailingPostalCode = '56363'), AND(VALUE([Contact].MailingPostalCode) >= 55001,VALUE([Contact].MailingPostalCode) <= 55036), AND(VALUE([Contact].MailingPostalCode) >= 55038,VALUE([Contact].MailingPostalCode) <= 55309), AND(VALUE([Contact].MailingPostalCode) >= 55311,VALUE([Contact].MailingPostalCode) <= 55313), AND(VALUE([Contact].MailingPostalCode) >= 55315,VALUE([Contact].MailingPostalCode) <= 55323), AND(VALUE([Contact].MailingPostalCode) >= 55325,VALUE([Contact].MailingPostalCode) <= 55328), AND(VALUE([Contact].MailingPostalCode) >= 55330,VALUE([Contact].MailingPostalCode) <= 55331), AND(VALUE([Contact].MailingPostalCode) >= 55336,VALUE([Contact].MailingPostalCode) <= 55341), AND(VALUE([Contact].MailingPostalCode) >= 55343,VALUE([Contact].MailingPostalCode) <= 55349), AND(VALUE([Contact].MailingPostalCode) >= 55356,VALUE([Contact].MailingPostalCode) <= 55384), AND(VALUE([Contact].MailingPostalCode) >= 55386,VALUE([Contact].MailingPostalCode) <= 55388), AND(VALUE([Contact].MailingPostalCode) >= 55390,VALUE([Contact].MailingPostalCode) <= 55599), AND(VALUE([Contact].MailingPostalCode) >= 55901,VALUE([Contact].MailingPostalCode) <= 56017), AND(VALUE([Contact].MailingPostalCode) >= 56020,VALUE([Contact].MailingPostalCode) <= 56021), AND(VALUE([Contact].MailingPostalCode) >= 56023,VALUE([Contact].MailingPostalCode) <= 56029), AND(VALUE([Contact].MailingPostalCode) >= 56032,VALUE([Contact].MailingPostalCode) <= 56039), AND(VALUE([Contact].MailingPostalCode) >= 56042,VALUE([Contact].MailingPostalCode) <= 56052), AND(VALUE([Contact].MailingPostalCode) >= 56057,VALUE([Contact].MailingPostalCode) <= 56058), AND(VALUE([Contact].MailingPostalCode) >= 56063,VALUE([Contact].MailingPostalCode) <= 56072), AND(VALUE([Contact].MailingPostalCode) >= 56078,VALUE([Contact].MailingPostalCode) <= 56080), AND(VALUE([Contact].MailingPostalCode) >= 56089,VALUE([Contact].MailingPostalCode) <= 56098)​)
Matthew10Matthew10
Have also tried that with no luck. When I enter the formula into an advanced formula editor, I’m getting an error that I’m missing an ‘=‘ and it doesn’t show where.
Gururaj BGururaj B
Better Try from this:
OR(   AND([Contact].MailingState = 'ME'),    AND([Contact].MailingState = 'Maine'),   AND([Contact].MailingState = 'IA'),   AND([Contact].MailingState = 'Iowa'),   AND([Contact].MailingState = 'IL'),   AND([Contact].MailingState = 'Illinois'),   AND([Contact].MailingState = 'MN'),   AND([Contact].MailingState = 'Minnesota'),   AND([Contact].MailingPostalCode = '55334'),   AND([Contact].MailingPostalCode = '55352'),   AND([Contact].MailingPostalCode = '55354'),   AND([Contact].MailingPostalCode = '55704'),   AND([Contact].MailingPostalCode = '55712'),   AND([Contact].MailingPostalCode = '55749'),   AND([Contact].MailingPostalCode = '55756'),   AND([Contact].MailingPostalCode = '56055'),   AND([Contact].MailingPostalCode = '56074'),   AND([Contact].MailingPostalCode = '56082'),   AND([Contact].MailingPostalCode = '56363'),   AND(VALUE([Contact].MailingPostalCode) >= 55001,VALUE([Contact].MailingPostalCode) <= 55036),   AND(VALUE([Contact].MailingPostalCode) >= 55038,VALUE([Contact].MailingPostalCode) <= 55309),   AND(VALUE([Contact].MailingPostalCode) >= 55311,VALUE([Contact].MailingPostalCode) <= 55313),   AND(VALUE([Contact].MailingPostalCode) >= 55315,VALUE([Contact].MailingPostalCode) <= 55323),   AND(VALUE([Contact].MailingPostalCode) >= 55325,VALUE([Contact].MailingPostalCode) <= 55328),   AND(VALUE([Contact].MailingPostalCode) >= 55330,VALUE([Contact].MailingPostalCode) <= 55331),   AND(VALUE([Contact].MailingPostalCode) >= 55336,VALUE([Contact].MailingPostalCode) <= 55341),   AND(VALUE([Contact].MailingPostalCode) >= 55343,VALUE([Contact].MailingPostalCode) <= 55349),   AND(VALUE([Contact].MailingPostalCode) >= 55356,VALUE([Contact].MailingPostalCode) <= 55384),   AND(VALUE([Contact].MailingPostalCode) >= 55386,VALUE([Contact].MailingPostalCode) <= 55388),   AND(VALUE([Contact].MailingPostalCode) >= 55390,VALUE([Contact].MailingPostalCode) <= 55599),   AND(VALUE([Contact].MailingPostalCode) >= 55901,VALUE([Contact].MailingPostalCode) <= 56017),   AND(VALUE([Contact].MailingPostalCode) >= 56020,VALUE([Contact].MailingPostalCode) <= 56021),   AND(VALUE([Contact].MailingPostalCode) >= 56023,VALUE([Contact].MailingPostalCode) <= 56029),   AND(VALUE([Contact].MailingPostalCode) >= 56032,VALUE([Contact].MailingPostalCode) <= 56039),   AND(VALUE([Contact].MailingPostalCode) >= 56042,VALUE([Contact].MailingPostalCode) <= 56052),   AND(VALUE([Contact].MailingPostalCode) >= 56057,VALUE([Contact].MailingPostalCode) <= 56058),   AND(VALUE([Contact].MailingPostalCode) >= 56063,VALUE([Contact].MailingPostalCode) <= 56072),   AND(VALUE([Contact].MailingPostalCode) >= 56078,VALUE([Contact].MailingPostalCode) <= 56080),AND(VALUE([Contact].MailingPostalCode) >=56089,VALUE([Contact].MailingPostalCode) <= 56098))
This was selected as the best answer
Matthew10Matthew10
That worked!  Thanks, Gururaj!