HOW TO SPLIT PARTS OF TEXT STRING INTO 6 COLUMNS

JuicyMusic

Board Regular
Joined
Jun 13, 2020
Messages
210
Office Version
  1. 365
Platform
  1. Windows
I have tried and tried. I can adjust these types of formula's (somewhat) if I need to......but I just can't figure this one out.

Normal request: How to extract text after the last space in a string? I can do this.
Unusual: How to extract text after the space BEFORE the last space in a string. I CAN'T DO THIS ONE:(

In a nut shell.....I need to split a string into 6 parts, and these 6 parts going into a different column on the same row.
See the image I uploaded. The spacing or order of information is always constant and won't change.

Column C : Original String
See the 2nd image uploaded to see what type of text goes into column D thru I. See my red text where I explain. TYSM!!!!!


Here is a string for example.
GB-200 130.00 EA 54" Freestanding Vanity $63,830.00 3000.030 Casegoods
 

Attachments

  • Screenshot_split string into 6 columns by color.png
    Screenshot_split string into 6 columns by color.png
    6.5 KB · Views: 28
  • Screenshot_Data snapshot showing 6 columns.png
    Screenshot_Data snapshot showing 6 columns.png
    11.7 KB · Views: 28

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hi there, I did change the number at the end to 2,3,4,5,6. No results. Just #NAME?.
 
Upvote 0
Try this:

=INDEX(TEXTSPLIT(SUBSTITUTE(SUBSTITUTE($A2,"0 ","0 /<>"),"$","/<>$"),"/<>"),{1,3,2,4,5,6})
 
Upvote 0
Do you have the textsplit, textbefore & textafter functions?
 
Upvote 0
Hi @JuicyMusic

Your data seems to be inconsistent at line 3 where there is no space between "GB-201" and "7.00".
Is that a typo?

If your data is inconsistent, it will be difficult to handle.
Meanwhile, here's a table with formulas that should work on your example string:

Book1.xlsm
CDEFGHI
1ORIGINAL TEXTHPGI CodeDescriptionCountTotal CostPH CodeType
2GB-200 130.00 EA 54" Freestanding Vanity $63,830.00 3000.030 CasegoodsGB-200 EA 54" Freestanding Vanity130.00$63,830.00 3000.030 Casegoods
Sheet35
Cell Formulas
RangeFormula
D2D2= LEFT(C2,FIND(" ",C2)-1)
E2E2= MID(C2,FIND(" ",C2,FIND(" ",C2)+1),FIND("~",SUBSTITUTE(C2," ","~",LEN(C2) - LEN( SUBSTITUTE(C2," ","") )-2))-FIND(" ",C2,FIND(" ",C2)+1))
F2F2= MID(C2,FIND(" ",C2)+1,FIND(" ",C2,FIND(" ",C2)+1)-FIND(" ",C2)-1)
G2G2= MID(C2,FIND("~",SUBSTITUTE(C2," ","~",LEN(C2) - LEN( SUBSTITUTE(C2," ","") )-2))+1,FIND("~",SUBSTITUTE(C2," ","~",LEN(C2) - LEN( SUBSTITUTE(C2," ","") )-1))-FIND("~",SUBSTITUTE(C2," ","~",LEN(C2) - LEN( SUBSTITUTE(C2," ","") )-2)))
H2H2= MID(C2,FIND("~",SUBSTITUTE(C2," ","~",LEN(C2) - LEN( SUBSTITUTE(C2," ","") )-1))+1,FIND("~",SUBSTITUTE(C2," ","~",LEN(C2) - LEN( SUBSTITUTE(C2," ","") )))-FIND("~",SUBSTITUTE(C2," ","~",LEN(C2) - LEN( SUBSTITUTE(C2," ","") )-1)))
I2I2= MID(C2,FIND("~",SUBSTITUTE(C2," ","~",LEN(C2) - LEN( SUBSTITUTE(C2," ","") ))),LEN(C2)-FIND("~",SUBSTITUTE(C2," ","~",LEN(C2) - LEN( SUBSTITUTE(C2," ","") )))+1)
PeteWright, this worked perfectly! I've been waiting to see the solution so I could ask a few questions.......but these formulas are so pretty but looking at them tells me nothing.🥺. Do you happen to know if there are online classes specifically for splitting text? I would love to be adept. TY for the solution. Juicy
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,217
Members
453,024
Latest member
Wingit77

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top