You need to sign in to do that
Don't have an account?
Glenn Nyhan 54
Need to Add European States to US/Canada State Abbreviation Validation Rule
I created a validation rule to make sure State field can only contain 2 letters (can also be blank), and must be in CAPS for US/Canada records. This rule also supports Canadian Provinces, which are also 2 letters and must also be in CAPS. But, we get membership requests from Europe where the State abbreviation is 3 letters like the one we got from Germany today which was NRW (North Rhein Westphalia), and so this rule in that case doesn't work:
AND(
NOT(ISBLANK(MailingState)),
OR(
LEN(MailingState) <> 2,
NOT(
CONTAINS("AL:AK:AZ:AR:CA:CO:CT:DE:DC:FL:GA:HI:ID:" &
"IL:IN:IA:KS:KY:LA:ME:MD:MA:MI:MN:MS:MO:MT:NE:NV:NH:" &
"NJ:NM:NY:NC:ND:OH:OK:OR:PA:RI:SC:SD:TN:TX:UT:VT:VA:" &
"WA:WV:WI:WY:PR:" & "AB:BC:MB:NB:NL:NT:NU:ON:PE:QC:SK:YT", MailingState)
)))
So I'm stuck as to what to do. Should I add this to the current rule?:
OR(
LEN(MailingState) <> 3
Let me know if anyone has a solution for this issue.
Thanks in advance.
Glenn
AND(
NOT(ISBLANK(MailingState)),
OR(
LEN(MailingState) <> 2,
NOT(
CONTAINS("AL:AK:AZ:AR:CA:CO:CT:DE:DC:FL:GA:HI:ID:" &
"IL:IN:IA:KS:KY:LA:ME:MD:MA:MI:MN:MS:MO:MT:NE:NV:NH:" &
"NJ:NM:NY:NC:ND:OH:OK:OR:PA:RI:SC:SD:TN:TX:UT:VT:VA:" &
"WA:WV:WI:WY:PR:" & "AB:BC:MB:NB:NL:NT:NU:ON:PE:QC:SK:YT", MailingState)
)))
So I'm stuck as to what to do. Should I add this to the current rule?:
OR(
LEN(MailingState) <> 3
Let me know if anyone has a solution for this issue.
Thanks in advance.
Glenn
You can use the below Validation rule:-
Mark it as answer if it works for you.
All Answers
You can use the below Validation rule:-
Mark it as answer if it works for you.
When I replaced the current formula with this and ran Syntax check everything was fine, but when the person doing data entry tried it it did not work. I made a few modifications and now it works. Thanks for the help.
Glenn
Just tell me your requirements. See if below requirememnts are correct:-
1.The MailingState should not be blank.
2.Length of Mailing state should be 2 or 3, nothing else.
3.Mailing state should not contain any of these :- AL:AK:AZ:AR:CA:CO:CT:DE:DC:FL:GA:HI:ID:" &
"IL:IN:IA:KS:KY:LA:ME:MD:MA:MI:MN:MS:MO:MT:NE:NV:NH:" &
"NJ:NM:NY:NC:ND:OH:OK:OR:PA:RI:SC:SD:TN:TX:UT:VT:VA:" &
"WA:WV:WI:WY:PR:" & "AB:BC:MB:NB:NL:NT:NU:ON:PE:QC:SK:YT
Do the corrections if needed and also add something which is missed.
"IL:IN:IA:KS:KY:LA:ME:MD:MA:MI:MN:MS:MO:MT:NE:NV:NH:" &, and will need to also contain 3 letter European State fields, Germany for instance, which has abbreviations such as North Rhine Westfalia ie. abbreviated as NRW.
"NJ:NM:NY:NC:ND:OH:OK:OR:PA:RI:SC:SD:TN:TX:UT:VT:VA:" &
"WA:WV:WI:WY:PR:" & "AB:BC:MB:NB:NL:NT:NU:ON:PE:QC:SK:YT