Salesforce
Validation Rules
Validation rules can help improve the quality of your data by verifying that the date entered by a user meets the standards you specify before the user can save the record.
Below is one that validates that the Account Shipping State/Province is a valid two-character abbreviation (if the Shipping Country is US, USA, or blank):
AND (
OR(ShippingCountry = "US", ShippingCountry="USA", LEN(ShippingCountry)=0),
OR(
LEN(ShippingState) < 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", ShippingState)
)))
To add the above validation rule, simply go to Setup-Customize-Account-Validation Rules.