Is there a formula to extract the state from an address?
Hi!!
Is there a formula to extract the state from the following address? The state should be after the comma and before the zip code number.
12345 Paris Rd Dallas, Texas 75240 United States Validation Status: Validated
9856 SLEEPING BEAR RD SKOKIE, Illinois 60076-1920 COOK United States Validation Status: Validated
333 E 123TH ST APT 195 NEW YORK, New York 10017-1628 NEW YORK United States Validation Status: Validated
556 Valley Ln. West Greenwich, Rhode Island 02817 United States Validation Status: Validated
Thank you for your help.
Best Answer
-
This was a fun one :)
Hope it works:
=MID(Address@row, FIND(", ", Address@row) + 2, FIND("~~~~~", SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(Address@row, "0", "~"), "1", "~"), "2", "~"), "3", "~"), "4", "~"), "5", "~"), "6", "~"), "7", "~"), "8", "~"), "9", "~"), FIND(", ", Address@row)) - FIND(", ", Address@row) - 3)
Answers
-
This was a fun one :)
Hope it works:
=MID(Address@row, FIND(", ", Address@row) + 2, FIND("~~~~~", SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(Address@row, "0", "~"), "1", "~"), "2", "~"), "3", "~"), "4", "~"), "5", "~"), "6", "~"), "7", "~"), "8", "~"), "9", "~"), FIND(", ", Address@row)) - FIND(", ", Address@row) - 3)
-
@Leibel S OMG, how do figure out this fast? YOU ARE AWESOME!!! Thank you <3
-
Hello! How would I edit this formula to find the 2 character state in the following address structure?
111 Alexander St, Memphis, TN 38111 [looking to return "TN"]
TYIA!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.6K Get Help
- 403 Global Discussions
- 214 Industry Talk
- 454 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 136 Just for fun
- 56 Community Job Board
- 456 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!