Splitting cells

chicoboss

New Member
Joined
Apr 10, 2013
Messages
10
HI everyone,


I have a very large data base, on a column we have a list of address + number. I want to separate the number from the address and put number on another cell.


Exp-
A1
Nachtegaalstraat 76

<tbody>
</tbody>


Split as following
B1
Nachtegaalstraat
C1
76

I hope i have been clear enough.

Many thanks for your help.
Regards,
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
welcome to the board..

Try Highlighting column A
Data - Text To Columns
Deliminated - next
Check Space - next
Destination: = B1
Click Finish.
 
Upvote 0
I have a very large data base, on a column we have a list of address + number. I want to separate the number from the address and put number on another cell.

Exp-
A1
Nachtegaalstraat 76

<TBODY>
</TBODY>


Split as following
B1
Nachtegaalstraat
C1
76
Will your addresses ever contain more than one word?
 
Upvote 0
Many thanks for your quick reply.

I tried that,

But it seems not to work because i have some addresses that are longer and with space and it will put every separation on a different cell.
I need to separate them into two cells
 
Upvote 0
Yes exp :
Van der Takstraat 1C

<TBODY>
</TBODY>
Can we assume 1C is the "number" at the end of your text? If so, give this macro a try...
Code:
Sub SplitNumberFromAddress()
  Dim Addr As String
  Addr = "A1:A" & Cells(Rows.Count, "A").End(xlUp).Row
  Range(Addr).Offset(, 1) = Evaluate("IF(LEN(" & Addr & "),TRIM(RIGHT(SUBSTITUTE(TRIM(" & _
                                     Addr & "),"" "",REPT("" "",99)),99)),"""")")
  Range(Addr) = Evaluate("IF(LEN(" & Addr & "),SUBSTITUTE(" & Addr & ","" ""&" & _
                         Range(Addr).Offset(, 1).Address & ",""""),"""")")
End Sub
 
Upvote 0
If we can just go by "Split at the last space in the cell"
And it can be assumed that the "number" will not be repeated within the Name..

Try
B1: =TRIM(SUBSTITUTE(A1,C1,""))
C1: =TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",LEN(A1))),LEN(A1)))

Note, the formula in B1 depends upon the result of the formula in C1.
So B1 will not be correct if you have not yet put the formula in C1
 
Upvote 0
If we can just go by "Split at the last space in the cell"
And it can be assumed that the "number" will not be repeated within the Name..

Try
B1: =TRIM(SUBSTITUTE(A1,C1,""))
C1: =TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",LEN(A1))),LEN(A1)))

Note, the formula in B1 depends upon the result of the formula in C1.
So B1 will not be correct if you have not yet put the formula in C1

When putting the formula in the bar i get an error : the formula you typed contains an error.
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

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