+ Reply to Thread
Results 1 to 7 of 7

Hello, I need a formula to extract the numbers from an alphanumerical cell

  1. #1
    Registered User
    Join Date
    12-06-2018
    Location
    Braga, Portugal
    MS-Off Ver
    office 2016
    Posts
    5

    Hello, I need a formula to extract the numbers from an alphanumerical cell

    The formula should do the following:

    ORIGIN --------- EXPECTED
    cell B3 -------- cell J3
    D11 -------- 11
    HEP100 -------- 100
    L70 * 7 -------- 70
    L70 * 123 ------ 70
    PL10 * 250----- 10

    I hope you can help.
    Thank you.
    Marco
    Last edited by MPLM; 12-12-2018 at 02:28 PM.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 2003, 2010, 2016 (Windows)
    Posts
    4,761

    Re: Hello, I need a formula to extract the numbers from an alphanumerical cell

    Array-enter (enter using Ctrl-Shift-Enter) this in J3:

    =SUM(MID(0&LEFT(B3,FIND(" ",B3&" ")-1),LARGE(INDEX(ISNUMBER(--MID(LEFT(B3,FIND(" ",B3&" ")-1),ROW($1:$99),1))*ROW($1:$99),),ROW($1:$99))+1,1)*10^ROW($1:$99)/10)

    You could also use VBA - copy the function below into a standard codemodule and save your workbook as a macro-enabled .xlsm and use the code like

    =FirstNum(B3)
    Please Login or Register  to view this content.
    Last edited by Bernie Deitrick; 12-12-2018 at 03:44 PM.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    12-06-2018
    Location
    Braga, Portugal
    MS-Off Ver
    office 2016
    Posts
    5

    Re: Hello, I need a formula to extract the numbers from an alphanumerical cell

    Hello Bernie, thanks for the help but the result of the formula is that it returns the last digit. You can help solve the problem.

    ORIGIN --------- EXPECTED------RESULT
    cell B3 -------- cell J3 -------- cell J3
    D11 -------- 11 -------- 1
    HEP100 -------- 100 -------- 0
    L70 * 7 -------- 70 -------- 7
    L70 * 123 ------ 70 -------- 3
    PL10* 250 ----- 10 -------- 0

    Thank you.
    Marco

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 2003, 2010, 2016 (Windows)
    Posts
    4,761

    Re: Hello, I need a formula to extract the numbers from an alphanumerical cell

    Array-enter the formula using Ctrl-Shift-Enter. If you do that correctly, Excel will show the formula within { } on the formula bar.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    It changes constantly, but based in Ireland.
    MS-Off Ver
    Excel 2013 & 2016
    Posts
    25,335

    Re: Hello, I need a formula to extract the numbers from an alphanumerical cell

    Here's a non-array formula to do the same thing:

    =TRIM(LOOKUP(99^99,--("0"&MID(B3,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},B3&"0123456789")),ROW($1:$100)))))+0
    Glenn



  6. #6
    Registered User
    Join Date
    12-06-2018
    Location
    Braga, Portugal
    MS-Off Ver
    office 2016
    Posts
    5

    Re: Hello, I need a formula to extract the numbers from an alphanumerical cell

    thank you very much Glenn and Bernie the formula
    works perfectly.
    Marco

  7. #7
    Registered User
    Join Date
    12-06-2018
    Location
    Braga, Portugal
    MS-Off Ver
    office 2016
    Posts
    5

    Re: Hello, I need a formula to extract the numbers from an alphanumerical cell

    Excelent Thank You

+ 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] Formula to extract numbers from cell?
    By ExcelBG in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-18-2017, 09:08 AM
  2. Is there a formula that will extract the numbers to the left of the cell
    By benji1973 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-04-2015, 10:11 AM
  3. Extract numbers from a sum formula inside a cell
    By cycloneclau in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-17-2014, 01:55 PM
  4. [SOLVED] Formula to Extract Numbers from Text Cell
    By MHamid in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-03-2012, 04:08 PM
  5. Extract largest number in an alphanumerical string
    By chitownsox14 in forum Excel General
    Replies: 16
    Last Post: 03-15-2011, 12:16 PM
  6. Extract all text after an alphanumerical letter
    By Kalid in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-04-2009, 11:34 AM
  7. [SOLVED] extract number and use in formula from text & numbers in cell
    By ivory_kitten in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-14-2006, 12:45 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