+ Reply to Thread
Results 1 to 3 of 3

formula to get the number from a string

  1. #1
    Forum Contributor
    Join Date
    02-18-2014
    Location
    hk
    MS-Off Ver
    Excel 365
    Posts
    105

    formula to get the number from a string

    Hi All,

    Is there any formula to get the number from a string?
    Thanks.

  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
    53,048

    Re: formula to get the number from a string

    depending on your data, either of these should work...
    =LOOKUP(99^99,--("0"&MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")),ROW($1:$10000)))) Courtesy of:*Ron Coderre
    =LEFT(A1,MIN(FIND({"0","1","2","3","4","5","6","7","8","9"},A1&"0123456789"))-1) Courtesy of sktneer

    Both assume your data is in A1 - adjust as needed
    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 Contributor
    Join Date
    02-18-2014
    Location
    hk
    MS-Off Ver
    Excel 365
    Posts
    105

    Re: formula to get the number from a string

    Thanks, FDibbins.
    Quote Originally Posted by FDibbins View Post
    depending on your data, either of these should work...
    =LOOKUP(99^99,--("0"&MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")),ROW($1:$10000)))) Courtesy of:*Ron Coderre
    =LEFT(A1,MIN(FIND({"0","1","2","3","4","5","6","7","8","9"},A1&"0123456789"))-1) Courtesy of sktneer

    Both assume your data is in A1 - adjust as needed

+ 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] Need a formula to isolate a number from a text string
    By chicolocal in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-25-2013, 01:19 PM
  2. [SOLVED] Add number sequentially to string based on formula
    By nickmax1 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-09-2012, 11:19 AM
  3. Formula to Remove 2nd Number Group From String
    By chbrandt in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 05-03-2011, 03:37 PM
  4. String Number Formula
    By freybe06 in forum Excel General
    Replies: 2
    Last Post: 02-15-2011, 05:37 PM
  5. Replies: 1
    Last Post: 01-25-2010, 12:48 PM

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