Text to Columns

Jonstevens

New Member
Joined
Mar 20, 2009
Messages
3
Hi, I have a column of data that I want to turn into two columns. The dividing point is a random number. Each cell is different than the others so the number shows up in different spaces making fixed width not possible. How can I make the change? Thanks
Jon
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,484
Re: Text to Collumns

provide examples of your data, please.............
 

Jonstevens

New Member
Joined
Mar 20, 2009
Messages
3
Re: Text to Collumns

Jane Smith CGM IRA Custodian 164 Main St
Jon Smith CGM IRA Rollover Custodian 543 Main St
Jane White CGM IRA Custodian 1567 Main St
Jon White 105 Main St
 

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,484
Re: Text to Collumns

Paste this UDF into a standard module

Function Getnum(inpt As String)
Dim i As Integer
For i = 1 To Len(inpt)
If IsNumeric(Mid(inpt, i, 1)) Then
Getnum = i
Getnum = CLng(Getnum)
Exit Function
End If
Next i
Getnum = CLng(Getnum)
End Function

Then with your furnished data in A1:A4 enter into B1 and copy down:

=LEFT(A1,Getnum(A1)-2)

Enter into C1: =RIGHT(A1,LEN(A1)-LEN(B1)-1) and copy down
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,944
Messages
5,856,446
Members
431,814
Latest member
Oriel Tzvi Shaer

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
Top