Split text into columns
I'd like to split text into separate columns.
The text (found in one cell) has the following form: company name-document type-yymmdd-version number
E.g. I'd like to split Architecture-Proposal-221129-001 into four columns:
- Company Name
- Document Type
- Date
- Version
Appreciate any help or advice.
Thanks,
Jacob
Best Answer
-
I would have had this done quickly a couple hours ago but everyone always complains about helper columns and having to create/hide them. So I built the helper columns first and then slowly eliminated the helper columns by building their formulas into the main formula for each one. So that took some time and troubleshooting to get it right. You sort of get lost in all the LEFT/RIGHT nonsense and forget which helper formula you're on.
Hope this helps!
Answers
-
Here's the one for Company:
=LEFT([Document Name]@row, FIND("-", [Document Name]@row) - 1)
Here's the one for Document Type:
=LEFT(RIGHT([Document Name]@row, LEN([Document Name]@row) - FIND("-", [Document Name]@row)), (FIND("-", RIGHT([Document Name]@row, LEN([Document Name]@row) - FIND("-", [Document Name]@row) - 1))))
I'm working on the other two still. It gets much more complex for the last two.
-
Thanks for the quick response. Is it easier if I eliminate the Document type column and just extract the Company Name, Date, and Version?
-
No. It would only be easy if you only wanted the first two names extrapolated out. The further down the chain we get the harder the formula gets. If the FIND command allowed you to find 2nd, 3rd, 4th instance of being found, that would help.
-
Oh, okay.
It's not urgent but if you're able to help build that formula, I'd really appreciate your help.
-
Date formula:
=LEFT(RIGHT(RIGHT([Document Name]@row, (LEN([Document Name]@row) - FIND("-", [Document Name]@row))), LEN([Document Name]@row) - FIND("-", [Document Name]@row) - FIND("-", RIGHT([Document Name]@row, (LEN([Document Name]@row) - FIND("-", [Document Name]@row))))), FIND("-", RIGHT(RIGHT([Document Name]@row, (LEN([Document Name]@row) - FIND("-", [Document Name]@row))), LEN([Document Name]@row) - FIND("-", [Document Name]@row) - FIND("-", RIGHT([Document Name]@row, (LEN([Document Name]@row) - FIND("-", [Document Name]@row)))))) - 1)
-
Version formula:
=RIGHT(RIGHT(RIGHT([Document Name]@row, (LEN([Document Name]@row) - FIND("-", [Document Name]@row))), LEN([Document Name]@row) - FIND("-", [Document Name]@row) - FIND("-", RIGHT([Document Name]@row, (LEN([Document Name]@row) - FIND("-", [Document Name]@row))))), LEN(RIGHT(RIGHT([Document Name]@row, (LEN([Document Name]@row) - FIND("-", [Document Name]@row))), LEN([Document Name]@row) - FIND("-", [Document Name]@row) - FIND("-", RIGHT([Document Name]@row, (LEN([Document Name]@row) - FIND("-", [Document Name]@row)))) - FIND("-", RIGHT(RIGHT([Document Name]@row, (LEN([Document Name]@row) - FIND("-", [Document Name]@row))), LEN([Document Name]@row) - FIND("-", [Document Name]@row) - FIND("-", RIGHT([Document Name]@row, (LEN([Document Name]@row) - FIND("-", [Document Name]@row)))))))))
-
I would have had this done quickly a couple hours ago but everyone always complains about helper columns and having to create/hide them. So I built the helper columns first and then slowly eliminated the helper columns by building their formulas into the main formula for each one. So that took some time and troubleshooting to get it right. You sort of get lost in all the LEFT/RIGHT nonsense and forget which helper formula you're on.
Hope this helps!
-
@Mike TV Thanks so much for your help with this.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 495 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!