+ Reply to Thread
Results 1 to 8 of 8

How can I remove unwanted text coming before a number? For all cells in a column?

  1. #1
    Registered User
    Join Date
    05-14-2015
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    2

    How can I remove unwanted text coming before a number? For all cells in a column?

    I am geocoding and the information I am working from has unwanted information in the cells.
    The way the data was sourced caused the cells to be a concatenation which is difficult to work with.
    Basically, I take "123 whatever st" and find the Lat/Long for this location. Thats my goal. Something I can plug into Google maps or a mapping API.

    The data (single cell) looks similar to this:

    Boyfriends House 123 Main St, Vancouver, BC
    or
    Main and Hastings 123 Main St, Vancouver, BC
    or
    123 main st 123 main st, Vancouver, BC

    I just need the "123 main st, Vancouver, BC" for the work. The other info just stops the geocoding dead.
    Removing the duplicate like in the 3rd example would be awesome, but an excellent start would be removing just the unneeded text
    How can I remove the data before the numbers from a cell?

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: How can I remove unwanted text coming before a number? For all cells in a column?

    This will give you wnat you want for the 1st 2...
    =MID(A1,FIND(LOOKUP(99^99,--("0"&MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")),ROW(1:10000)))),A1,1),99)

    Main formula Courtesy of:*Ron Coderre
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: How can I remove unwanted text coming before a number? For all cells in a column?

    This array-entered formula will find the second number if the first one is not preceded by a space.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Array formulas are not committed in the regular way. You commit by pressing and holding Ctrl + Shift as you hit Enter. You will know that it has been entered successfully when you can see curly braces {} around your formula in the formula bar. You do not type these in yourself. Excel does it for you.

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: How can I remove unwanted text coming before a number? For all cells in a column?

    This array entered formula...so far... returns string starting at the last address.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Edit BTW the addition of the row(indirect..etc. in the 3rd argument of FIND is something I borrowed from AlKey.
    Last edited by FlameRetired; 05-14-2015 at 08:33 PM.

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How can I remove unwanted text coming before a number? For all cells in a column?

    Regular formula in B1 and copy down

    =REPLACE(A1,1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&1/17,FIND(" ",A1)))-1,"")

    Row\Col
    A
    B
    1
    Boyfriends House 123 Main St, Vancouver, BC 123 Main St, Vancouver, BC
    2
    Main and Hastings 123 Main St, Vancouver, BC 123 Main St, Vancouver, BC
    3
    123 main st 123 main st, Vancouver, BC 123 main st, Vancouver, BC
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: How can I remove unwanted text coming before a number? For all cells in a column?

    Quote Originally Posted by AlKey View Post
    Regular formula in B1 and copy down

    =REPLACE(A1,1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&1/17,FIND(" ",A1)))-1,"")

    Row\Col
    A
    B
    1
    Boyfriends House 123 Main St, Vancouver, BC 123 Main St, Vancouver, BC
    2
    Main and Hastings 123 Main St, Vancouver, BC 123 Main St, Vancouver, BC
    3
    123 main st 123 main st, Vancouver, BC 123 main st, Vancouver, BC
    What if the first number is preceded by a space or some other text?

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How can I remove unwanted text coming before a number? For all cells in a column?

    Quote Originally Posted by FlameRetired
    What if the first number is preceded by a space or some other text?
    Yes, that could be a problem. But nothing that can't be fixed

    =REPLACE(A1,1,LOOKUP(10^308,SEARCH(" "&{0,1,2,3,4,5,6,7,8,9},A1&1/17)),"")
    Last edited by AlKey; 05-14-2015 at 11:17 PM.

  8. #8
    Registered User
    Join Date
    05-14-2015
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    2

    Re: How can I remove unwanted text coming before a number? For all cells in a column?

    Wow, quick response. Thanks, that helps alot and worked perfectly.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Remove unwanted text/ numbers from name
    By MATU70 in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 05-13-2014, 02:31 PM
  2. Replies: 11
    Last Post: 04-25-2012, 01:42 PM
  3. Remove unwanted cells
    By C-Shore in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-09-2011, 12:04 PM
  4. Excel 2007 : Remove Unwanted Text from Cells
    By rickygzz in forum Excel General
    Replies: 6
    Last Post: 08-01-2011, 10:28 PM
  5. Convert Excel cells stored as text to date and number coming from notepad
    By Fire_d in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-31-2010, 12:34 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1