+ Reply to Thread
Results 1 to 6 of 6

Only first numbers extract

  1. #1
    Forum Contributor
    Join Date
    03-17-2010
    Location
    karachi
    MS-Off Ver
    Excel 2003
    Posts
    113

    Only first numbers extract

    Hi,

    can any one help me i want to extract only first numbers in string like
    "new trick#14- fhf 34" to extract only 14 and
    "dfr new trick 1 fdff 7 df 787" to 1
    "dff -trt# 77 df 4 " to 77

    Is this possible?

    thanks

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,923

    Re: Only first numbers extract

    Try this:

    =LOOKUP(10^17,--MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"1234567890")),{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}))

  3. #3
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Only first numbers extract

    You could use a UDF like this
    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  4. #4
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Only first numbers extract

    I found this on another forum.

    =MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")),2)+0 - this will work provided the first number found is 1 or 2 digits.

    I hope this helps, please let me know!

    Regards,

    David

    If this has been helpful
    - Please click on the *Add Reputation button at the bottom left.

    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".


  5. #5
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,923

    Re: Only first numbers extract

    UDF
    Please Login or Register  to view this content.

  6. #6
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,923

    Re: Only first numbers extract

    Or try:
    Please Login or Register  to view this content.

+ 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] Extract two numbers from text if two numbers exist
    By maym in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-02-2017, 01:08 PM
  2. [SOLVED] How to Display Numbers Only OR How To Extract Numbers In A Cell
    By PaddyP in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-17-2016, 12:32 PM
  3. How do extract numbers with a pattern from a list of numbers ?
    By kcolraw in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-01-2012, 04:04 AM
  4. Replies: 2
    Last Post: 05-02-2006, 11:20 AM
  5. Extract numbers from cell with Text and Numbers
    By wiredwrx in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 04-18-2006, 06:00 PM
  6. [SOLVED] extract numbers from cell containing text & numbers
    By [email protected] in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-14-2005, 03:10 AM
  7. [SOLVED] Extract Fractional Numbers as Numbers NOT Date
    By MrBill in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-02-2005, 06:17 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