Remove Characters or Numbers of Variable Length from a String

dcasciato

New Member
Joined
Mar 20, 2021
Messages
4
Office Version
  1. 365
Platform
  1. Windows
How would you trim the number from the street address?
As you will see below the number and following street address are both variable length.
The problem is when the "number" is variable length. Let's look at two scenarios...


Thanks in Advance - Dan
AddressDesired Result
123 Main Street
123​
12 Anywhere Lane
12​
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Try:
Excel Formula:
=TEXTBEFORE(A2," ")
This will extract everything before the first space in your string.
 
Upvote 0
Solution
One final thought - flash fill will not work as I need the "number" to include in a formula
 
Upvote 0
Try:
Excel Formula:
=TEXTBEFORE(A2," ")
This will extract everything before the first space in your string.
WooHoo - this is exactly what I was looking for! Thank you Joe4 for the quick response.
 
Upvote 0
You are welcome.
Yes, the new TEXTBEFORE and TEXTAFTER functions are great!
 
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,924
Members
452,366
Latest member
TePunaBloke

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