+ Reply to Thread
Results 1 to 5 of 5

How to find any number in a string

  1. #1
    Forum Contributor
    Join Date
    08-29-2011
    Location
    Minnesota
    MS-Off Ver
    Office 365
    Posts
    163

    How to find any number in a string

    The goal is to extract just the names from the below addresses, and my idea was to use InStr() to find the first number which I could incorporate into Left(), but I don't know how to make Excel differentiate between letters and numbers.

    Please Login or Register  to view this content.
    Any ideas would be appreciated! Thanks!

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: How to find any number in a string

    Assuming data in col.A from A1 and out put in Col.B
    Please Login or Register  to view this content.
    Last edited by jindon; 02-03-2022 at 11:58 AM. Reason: Add trim function for the safety.

  3. #3
    Forum Contributor
    Join Date
    08-29-2011
    Location
    Minnesota
    MS-Off Ver
    Office 365
    Posts
    163

    Re: How to find any number in a string

    That'll work Jindon - thanks! Now to go to Google and learn what exactly is going on in that formula so I can incorporate into my VBA toolbox.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: How to find any number in a string

    min(search({0,1,2,3,4,5,6,7,8,9},rc[-1]&""0123456789""))

    Is finding the position of the first appearing number within a cell.
    The reason for adding 0123456789 is to avoid error when the string is missing any one of number(s).

    HTH

  5. #5
    Forum Contributor
    Join Date
    08-29-2011
    Location
    Minnesota
    MS-Off Ver
    Office 365
    Posts
    163

    Re: How to find any number in a string

    That helps immensely! Thanks a ton!

+ 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 where there is any number in a string
    By rockell333 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-18-2016, 05:14 PM
  2. [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
  3. 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
  4. find position of a number in a string
    By fullers80 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 09:05 PM
  5. 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
  6. find position of a number in a string
    By fullers80 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12: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, 08:05 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