+ Reply to Thread
Results 1 to 6 of 6

Find where there is any number in a string

Hybrid View

  1. #1
    Registered User
    Join Date
    02-08-2012
    Location
    Long Island
    MS-Off Ver
    Excel 2007 or Excel 2003
    Posts
    76

    Find where there is any number in a string

    I am trying to parse addresses where the company name is in the same field.

    I wanted to use find and then left and right, however i cannot use an or with find

    For instance I have these addresses:

    Loga Square East,27 Franklin Town Blvd Apt 1103
    Londonbury Homes Inc 432 Jane St


    for the first one i used =FIND("2",J1216) to give me the location of the 2 and then used len to see how long it is and then ran a left and a right function to parse.

    There are two issues. Obviously the second addresses starts with a four so i need to include and OR and all the number 1,2,3,4,5,6,7,8,9.
    Second issue is that i do not what it to find both the 2 and the 7 in the first address.

    Any good formulas you can think of. We have thousands of addresses like this and it takes forever to do manually.

    Is there a formula that can just locate the first number?

  2. #2
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Find where there is any number in a string

    =MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789"))

    Should return the position of the first number in A1

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Find where there is any number in a string

    Quote Originally Posted by cantosh View Post
    =MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789"))
    Tips...

    Since numbers don't have a case property FIND will work and saves a couple of keystrokes.

    With the string concatenation, if you put the 0 last you don't need the quotes and can save a couple more keystrokes.

    =MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&1234567890))

    =MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789"))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Find where there is any number in a string

    Quote Originally Posted by Tony Valko View Post
    =MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&1234567890))
    Hadn't thought about the "0" placement. Good point!

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Find where there is any number in a string





    -------------

  6. #6
    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: Find where there is any number in a string

    To get the LEFT part:
    formula in B1 and copy down
    Formula: copy to clipboard
    =SUBSTITUTE(LEFT(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&1/17))-1),",","")

    v A B
    1 Loga Square East,27 Franklin Town Blvd Apt 1103 Loga Square East
    2 Londonbury Homes Inc 432 Jane St Londonbury Homes Inc
    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

+ 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] Find Largest Number In String
    By mrmoc85 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-16-2013, 12:38 AM
  2. Find nth number in a string, excel
    By Luoar in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-04-2013, 07:33 AM
  3. [SOLVED] Find any number within string
    By R. Choate in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-21-2005, 11:05 PM
  4. find position of a number in a string
    By fullers80 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-07-2005, 12:05 AM
  5. find position of a number in a string
    By Dave Peterson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 11:05 PM
  6. find position of a number in a string
    By Dave Peterson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 08:05 PM
  7. find position of a number in a string
    By fullers80 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 PM
  8. [SOLVED] find position of a number in a string
    By fullers80 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM

Tags for this Thread

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