How would I split text separated by commas into new cells?
Example, in one cell I have the text "Boston, MA, USA"
How do I split that to have Boston in one column, MA in the second, and USA in the third, all on the same row?
Answers
-
Let's say that your text "Boston, MA, USA" is in a column called "Location" and that you want to separate the text into three columns called City, State, and Country. The formulas that work for me are as follows:
City: =LEFT(Location@row, FIND(", ", Location@row) - 1)
State: =MID(Location@row, FIND(", ", Location@row) + 1, FIND(", ", Location@row, FIND(", ", Location@row) + 1) - FIND(", ", Location@row) - 1)
Country: =RIGHT(Location@row, LEN(Location@row) - FIND(", ", Location@row, FIND(", ", Location@row) + 1) - 1)
Does this help?
-
Thank you Kelly. I will test that. How would you edit that in case the data came across as ['Boston','MA','USA']? I just learned thats likely how it will come across.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 439 Global Discussions
- 138 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 67 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!