Formula to convert text to columns at changing character

RAJESH1960

Banned for repeated rules violations
Joined
Mar 26, 2020
Messages
2,313
Office Version
  1. 2019
Platform
  1. Windows
Hello again,
I am trying to convert this data from text to columns at each change in character"," with the help of a formula in each of the 8 cells, as the data may contain a maximum 8 such characters. I got the first one right with DanteAmor's formula, but I am not able to get the remaining formulas. Please note that there are 2",," in some cases in which case I may get a blank cell. That will be not a problem.
Query to seperate number and date with formula.xlsx
ABCDEFGHI
1Address12345678
2NO 2420, 2ND FLOOR, BUILDING NO 25B, MITTAL ESTATE, ANDHERI(E)NO 2420,
3#129, 4th Block,, 2nd Stage, HBR Layout, Bangalore-560043, Mob:12345678#129,
4 
51234 Situated MG Road, KG Halli Near GMR Circle, Bangalore1234 Situated MG Road,
62613 Kamraj Road, Bangalore - 5600422613 Kamraj Road,
7No.1235, Ground Floor,, PB Chambers, Opp. Sun Medicals, Kamaraj Road, Bangalore-560042No.1235,
8420, NKK Complex, SP Road, Bangalore420,
92510, PANDESARA, Behind RACHNA ENTERPRISES, SURAT2510,
10 
11840- Agraham Street, Erode840- Agraham Street,
12 
Sheet2
Cell Formulas
RangeFormula
B2:B12B2=IFERROR(LEFT(A2,FIND(",",A2)),"")
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Hi

Excel Formula:
=IFERROR(TRANSPOSE(FILTERXML("<y><z>"&SUBSTITUTE(A2,",","</z><z>")&"</z></y>","//z")),"")
 
Upvote 0
Hi

Excel Formula:
=IFERROR(TRANSPOSE(FILTERXML("<y><z>"&SUBSTITUTE(A2,",","</z><z>")&"</z></y>","//z")),"")
Hello, I am able to get the first part in column B. How do I get the remaining data in other columns.?
 
Upvote 0
Hi,

This should do it:

Book3.xlsx
ABCDEFGHI
1Address12345678
2NO 2420, 2ND FLOOR, BUILDING NO 25B, MITTAL ESTATE, ANDHERI(E)NO 24202ND FLOORBUILDING NO 25BMITTAL ESTATEANDHERI(E)   
3#129, 4th Block,, 2nd Stage, HBR Layout, Bangalore-560043, Mob:12345678#1294th Block 2nd StageHBR LayoutBangalore-560043Mob:12345678 
4        
51234 Situated MG Road, KG Halli Near GMR Circle, Bangalore1234 Situated MG RoadKG Halli Near GMR CircleBangalore     
62613 Kamraj Road, Bangalore - 5600422613 Kamraj RoadBangalore - 560042      
7No.1235, Ground Floor,, PB Chambers, Opp. Sun Medicals, Kamaraj Road, Bangalore-560042No.1235Ground Floor PB ChambersOpp. Sun MedicalsKamaraj RoadBangalore-560042 
8420, NKK Complex, SP Road, Bangalore420NKK ComplexSP RoadBangalore    
92510, PANDESARA, Behind RACHNA ENTERPRISES, SURAT2510PANDESARABehind RACHNA ENTERPRISESSURAT    
10        
11840- Agraham Street, Erode840- Agraham StreetErode      
Sheet971
Cell Formulas
RangeFormula
B2:I11B2=TRIM(MID(SUBSTITUTE($A2,",",REPT(" ",100)),COLUMNS($B2:B2)*100-99,100))
 
Upvote 0
Solution
Hi,

This should do it:

Book3.xlsx
ABCDEFGHI
1Address12345678
2NO 2420, 2ND FLOOR, BUILDING NO 25B, MITTAL ESTATE, ANDHERI(E)NO 24202ND FLOORBUILDING NO 25BMITTAL ESTATEANDHERI(E)   
3#129, 4th Block,, 2nd Stage, HBR Layout, Bangalore-560043, Mob:12345678#1294th Block 2nd StageHBR LayoutBangalore-560043Mob:12345678 
4        
51234 Situated MG Road, KG Halli Near GMR Circle, Bangalore1234 Situated MG RoadKG Halli Near GMR CircleBangalore     
62613 Kamraj Road, Bangalore - 5600422613 Kamraj RoadBangalore - 560042      
7No.1235, Ground Floor,, PB Chambers, Opp. Sun Medicals, Kamaraj Road, Bangalore-560042No.1235Ground Floor PB ChambersOpp. Sun MedicalsKamaraj RoadBangalore-560042 
8420, NKK Complex, SP Road, Bangalore420NKK ComplexSP RoadBangalore    
92510, PANDESARA, Behind RACHNA ENTERPRISES, SURAT2510PANDESARABehind RACHNA ENTERPRISESSURAT    
10        
11840- Agraham Street, Erode840- Agraham StreetErode      
Sheet971
Cell Formulas
RangeFormula
B2:I11B2=TRIM(MID(SUBSTITUTE($A2,",",REPT(" ",100)),COLUMNS($B2:B2)*100-99,100))
How about the formulas in column C to I.?
 
Upvote 0
You're welcome, thanks for the feedback.
 
Upvote 0
Hello, I am able to get the first part in column B. How do I get the remaining data in other columns.?
I didn't recognize that you are on an older version of Excel.
Try this amended formula instead:
Excel Formula:
=IFERROR(INDEX(FILTERXML("<y><z>"&SUBSTITUTE($A2,",","</z><z>")&"</z></y>","//z"),B$1),"")
 
Upvote 0
I didn't recognize that you are on an older version of Excel.
Try this amended formula instead:
Excel Formula:
=IFERROR(INDEX(FILTERXML("<y><z>"&SUBSTITUTE($A2,",","</z><z>")&"</z></y>","//z"),B$1),"")
Thanks for your help. Your formula too works perfectly.
 
Upvote 0

Forum statistics

Threads
1,215,759
Messages
6,126,731
Members
449,333
Latest member
Adiadidas

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