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
 

Some videos you may like

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,478
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,478
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
 

Watch MrExcel Video

Forum statistics

Threads
1,122,372
Messages
5,595,787
Members
414,021
Latest member
whyjaydee

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