Reputation: 12191
I have got a list of cells in this format:
A1 >> Industry Type: Home & Garden,Import/Export/Wholesale, Location: Auckland,Hawkes Bay,Wellington, PriceRange: $250,000 to $400,000, Order By: Latest Listings
A2 >> Industry Type: Retail General,Technology / Computer / IT,Retail Food,Cafes, Location: Auckland,Wellington, PriceRange: Up to $100,000, Order By: Latest Listings
For both of the two cells, I need to split their label and content. So for the first cell, it would be (assuming the content beside | are two cells):
Industry Type: | Home & Garden,Import/Export/Wholesale, | Location: | Auckland,Hawkes Bay,Wellington, | PriceRange: | $250,000 to $400,000, | Order By: | Latest Listings
How do I split text with both string and semicolon?
Upvotes: 0
Views: 153
Reputation: 5844
If your data is always in the same order (Industry Type, Location, PriceRange and Order By), you could use a series of formulas to extract.
Cell B1 enter:
=LEFT(RIGHT(A1, LEN(A1)-15),FIND(", Location",RIGHT(A1,LEN(A1)-15))-1)
Cell C1 enter:
=LEFT(RIGHT(A1,LEN(A1)-SUM(15,LEN(B1),12)),FIND(", Price",RIGHT(A1,LEN(A1)-SUM(15,LEN(B1),12)))-1)
Cell D1 enter:
=LEFT(RIGHT(A1,LEN(A1)-SUM(15,LEN(B1),12,LEN(C1),14)),FIND(", Order",RIGHT(A1,LEN(A1)-SUM(15,LEN(B1),12,LEN(C1),14)))-1)
Cell E1 enter:
=RIGHT(A1,LEN(A1)-SUM(15,LEN(B1),12,LEN(C1),14,LEN(D1),12))
Then copy all the formulas down for all your information.
It's possible to clean this up a bit with some named ranges, or even VBA, but this will get the job done.
Upvotes: 1