Forum Discussion

JonathanHeuer's avatar
JonathanHeuer
Qrew Cadet
11 years ago

Converting state address field into two letter abbreviation

The state address field displays the full name of the state. I would like to get the two letter abbreviation (i.e. "MI" instead of "Michigan"). Besides creating my own lookup table, is there another way?

17 Replies

  • Thanks guys, very helpful. I ended up converting the state/region to upper and used Contains within an IF. Maybe that's possible with Case but I couldn't seem to get it to work.

    If (
    Contains(Upper([Ship To: State/Region]),"ALABAMA"), "AL",
    Contains(Upper([Ship To: State/Region]),"ALASKA"), "AK",
    Contains(Upper([Ship To: State/Region]),"ARIZONA"), "AZ",
    Contains(Upper([Ship To: State/Region]),"ARKANSAS"), "AR",.........etc.
  • Just in case someone wants the reverse, here it is.

    Case([State],
    "AL", "Alabama",
    "AK", "Alaska",
    "AZ", "Arizona",
    "AR", "Arkansas",
    "CA", "California",
    "CO", "Colorado",
    "CT", "Connecticut",
    "DE", "Delaware",
    "FL", "Florida",
    "GA", "Georgia",
    "HI", "Hawaii",
    "ID", "Idaho",
    "IL", "Illinois",
    "IN", "Indiana",
    "IA", "Iowa",
    "KS", "Kansas",
    "KY", "Kentucky",
    "LA", "Louisiana",
    "ME", "Maine",
    "MD", "Maryland",
    "MA", "Massachusetts",
    "MI", "Michigan",
    "MN", "Minnesota",
    "MS", "Mississippi",
    "MO", "Missouri",
    "MT", "Montana",
    "NE", "Nebraska",
    "NV", "Nevada",
    "NH", "New Hampshire",
    "NJ", "New Jersey",
    "NM", "New Mexico",
    "NY", "New York",
    "NC", "North Carolina",
    "ND", "North Dakota",
    "OH", "Ohio",
    "OK", "Oklahoma",
    "OR", "Oregon",
    "PA", "Pennsylvania",
    "RI", "Rhode Island",
    "SC", "South Carolina",
    "SD", "South Dakota",
    "TN", "Tennessee",
    "TX", "Texas",
    "UT", "Utah",
    "VT", "Vermont",
    "VA", "Virginia",
    "WA", "Washington",
    "WV", "West Virginia",
    "WI", "Wisconsin",
    "WY", "Wyoming")
  • Is there a way to take the formula field & automatically change [Address:  State/Region]?  

    The formulas above changed the [Address:  State/Region] to the format I needed, but I have over 10k records where the [Address:  State/Region] fields needs to be changed to the formula field.