Remove everything after 4th space including the space

realestateexcel

New Member
Joined
Apr 25, 2017
Messages
3
Hi

First time posting. I am a huge fan of Excel I use it everyday at work and it is amazing what it can do. I have a list of addresses and I need to remove the unit numbers at the end from. Please see below. I am thinking is there a way to remove everything after the 4th space. Thank You in advance for the help.

1007 W Armitage Ave 107
1008 W Altgeld St
1018 W Armitage Ave 607
2719 W Belmont St 1

Change to


<colgroup><col></colgroup><tbody>
</tbody>
1007 W Armitage Ave
1008 W Altgeld St
1018 W Armitage Ave
2719 W Belmont St



<colgroup><col></colgroup><tbody>
</tbody>
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
What happens if there is not a 4th space? This formula removes everything after (and including( the 4th space and will return the value if there is not a 4th space:

=IFERROR(LEFT(SUBSTITUTE(A1," ","|",4),FIND("|",SUBSTITUTE(A1," ","|",4))-1),A1)
 
Upvote 0
Here you go.


Excel 2010
AB
11007 W Armitage Ave 1071007 W Armitage Ave
21008 W Altgeld St1008 W Altgeld St
31018 W Armitage Ave 6071018 W Armitage Ave
42719 W Belmont St 12719 W Belmont St
Sheet1
Cell Formulas
RangeFormula
B1=TRIM(LEFT(SUBSTITUTE(A1," ",REPT(" ",999), 4),255))
 
Upvote 0

Unknown
AB
11007 W Armitage Ave 1071007 W Armitage Ave
21008 W Altgeld St1008 W Altgeld St
31018 W Armitage Ave 6071018 W Armitage Ave
42719 W Belmont St 1279 W Belmont St
Sheet3
Cell Formulas
RangeFormula
B1=IF(ISNUMBER(RIGHT(A1,1)+0),SUBSTITUTE(A1,TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",50)),50)),""),A1)
 
Upvote 0
And another option :)

=LEFT(A1,FIND("|",SUBSTITUTE(A1," ","|",4)&"|")-1)

Welcome to the board btw!
 
Upvote 0

Forum statistics

Threads
1,215,637
Messages
6,125,965
Members
449,276
Latest member
surendra75

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