+ Reply to Thread
Results 1 to 35 of 35

formula extract number

  1. #1
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    formula extract number

    Hello in the attached sheet in column S there are numbers with letters:
    001>
    C100
    C100
    C100
    100
    100
    C100
    005>
    I ask for help to extract the number and then insert it into the corresponding cell of column X
    john
    Attached Files Attached Files

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: formula extract number

    Please try at X3 copy down

    =IF(S3="","",-LOOKUP(1,-MID(S3,MIN(FIND({0,1,2,3,4}+{0;5},S3&1/17)),{1,2,3,4})))

  3. #3
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: formula extract number

    Hi bo_ry
    error #N/D

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: formula extract number

    Which string gives the error you report?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: formula extract number

    Please see attached then,
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: formula extract number

    Ok bo_ry is almost correct.
    because if the cell format is percentage, the number becomes + 100?
    example your formula 1 with percentage becomes 100%
    example your formula 100 with percentage becomes 10000%

  7. #7
    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: formula extract number

    Maybe this
    Enter formula in X3 and copy down
    Format Col X as Percentage
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    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

  8. #8
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: formula extract number

    Hi alkey it's ok.
    it is possible to add to the formula if the value is 0 or empty the word "NOT TREATED" is inserted

  9. #9
    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: formula extract number

    Try this
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: formula extract number

    Hi Alkey the new formula work!
    is it possible to add a change?
    Now works:
    if S3 is zero or empty add "NOT TREATED" otherwise put the formula.
    The modica: if M3 is empty do not put "NOT TREATED" and the formula.
    john

  11. #11
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: formula extract number

    Try this

    =IF(M3="","",IFERROR(1/(1/-LOOKUP(1,-MID(S3,MIN(FIND({0,1,2,3,4}+{0;5},S3&1/17)),{1,2,3,4}))*100),"NOT TREATED"))

  12. #12
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: formula extract number

    Hi bo_ry not work remains "NOT TREATED"

  13. #13
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: formula extract number

    Hi error #N/D

    italian: =SE(O(S5={"";0});"NOT TREATED";SE.ERRORE(-CERCA(1;-DESTRA(S5;{1;2;3;4}));-CERCA(1;-SINISTRA(S5;{1;2;3;4})))/100)
    english: =IF(OR(S5={"",0}),"NOT TREATED",IFERROR(-LOOKUP(1,-RIGHT(S5,{1,2,3,4})),-LOOKUP(1,-LEFT(S5,{1,2,3,4})))/100)
    if:

    >100>
    C100>
    C50>

    john

  14. #14
    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: formula extract number

    Try this one
    In cell M3 enter any character
    then enter formula in Cell X3 and copy down

    Format Col X as Percentage

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Please see attached file.
    Attached Files Attached Files

  15. #15
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: formula extract number

    Hi alkey not work
    if M3/S3 empty in X3 = NOT TREATED
    case: C100> no work
    attach esample.
    john
    Attached Files Attached Files

  16. #16
    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: formula extract number

    You should never use merged cells especially on the cells that you calculate. All you are going to get is more problems.

  17. #17
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: formula extract number

    unfortunately it must work on merged cells

  18. #18
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: formula extract number

    Is this right?

    Formula from Post #11
    Attached Files Attached Files

  19. #19
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: formula extract number

    Hi bo_ry it's o.k, thanks you
    A greeting
    john

  20. #20
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: formula extract number

    Hi I tried your formula in a workbook but I can not solve a problem.
    Now your formula is in sheet1 column X
    In the M / S columns there are formulas that join the rows of the sheet2.
    The problem is that if in the M / S columns there are some errors like #NAME! then your formula does not work.
    I enclose the example.
    john
    Attached Files Attached Files

  21. #21
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: formula extract number

    #NAME! is Error, then

    sheet1
    M3 =ifferror(,"") so it show blank, then

    X3 formula =IF(M3="","", check M3 is blank so it also show blank

    What you you what to show on which cell?

  22. #22
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: formula extract number

    If in M3/M4 Sheet2 there is error in M3 Sheet1 must see only 1 row without error

  23. #23
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: formula extract number

    M3 Sheet1

    =IFERROR(INDEX(Foglio2!$M$3:$M$614,ROW(M1)*2-1),"")&" "&IFERROR(INDEX(Foglio2!$M$3:$M$614,ROW(M2)*2-2),"")
    Attached Files Attached Files

  24. #24
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: formula extract number

    Hi bo_ry work well
    Now the problem is only for the word NOT TREATED
    In X3 sheet1 if M3/S3 sheet2 are empty in
    X3 sheet1 does not have to see the word NOT TREATED
    john
    Attached Files Attached Files

  25. #25
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: formula extract number

    Please try X3

    =IF((M3=" ")+(S3=" "),"",IFERROR(1/(1/-LOOKUP(1,-MID(S3,MIN(FIND({0,1,2,3,4}+{0;5},S3&1/17)),{1,2,3,4}))*100),"NOT TREATED"))
    Attached Files Attached Files

  26. #26
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: formula extract number

    BO_RY your new formula work.
    Not work for this case:
    If M3 and S3 is empty or M3 not empty and S3 is empty

    =IF((((M3=" ")+(S3=" "))OR((M3>0)+(S3=" "))),"",IFERROR........

    not work error.

  27. #27
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: formula extract number

    Change all

    M3
    =TRIM(IFERROR(INDEX(Foglio2!$M$3:$M$606,ROW(M1)*2-1),"")&" "&IFERROR(INDEX(Foglio2!$M$3:$M$606,ROW(M2)*2-2),""))

    S3
    =TRIM(IFERROR(INDEX(Foglio2!$S$3:$S$606,ROW(S1)*2-1),"")&" "&IFERROR(INDEX(Foglio2!$S$3:$S$606,ROW(S2)*2-2),""))

    X3
    =IF((M3="")+(S3=""),"",IFERROR(1/(1/-LOOKUP(1,-MID(S3,MIN(FIND({0,1,2,3,4}+{0;5},S3&1/17)),{1,2,3,4}))*100),"NOT TREATED"))
    Attached Files Attached Files

  28. #28
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: formula extract number

    in no case does NOT TREATED come out

  29. #29
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: formula extract number

    Hi
    this formula:

    =IF(M3="","",IFERROR(1/(1/-LOOKUP(1,-MID(S3,MIN(FIND({0,1,2,3,4}+{0\5},S3&1/17)),{1,2,3,4}))*100),"NOT TREATED"))

    if M3 is empty inserts NOT TRATED if not empty inserts the formula.

    I request a change.
    if M3 and S3 are empty, do not insert NOT TREARED and do not enter the formula, it must remain empty.
    if M3 is not empty and S3 is empty, enter NOT TREATED
    if M3 and S3 are not empty, enter the formula.

  30. #30
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,421

    Re: formula extract number

    You might want to remove the SOLVED tag from the thread.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  31. #31
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: formula extract number

    What about if M3 is empty and S3 is not empty?

  32. #32
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: formula extract number

    Maybe

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  33. #33
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: formula extract number

    Hi bor_ry

    What about if M3 is empty and S3 is not empty?

    no this case

  34. #34
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: formula extract number

    Please try
    =IF(M3&S3="","",IF(S3="","NOT TREATED",-LOOKUP(1,-MID(S3,MIN(FIND({0,1,2,3,4}+{0\5},S3&1/17)),{1,2,3,4}))/100))

    If this still not work then please upload you sheet with expected result.

  35. #35
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: formula extract number

    Hi bo_ry
    the last modification should be correct.
    To be sure, I have to try it in the office next week
    Greetings and thanks.
    john

+ 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 number
    By mainemojo in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-27-2018, 02:10 PM
  2. [SOLVED] Extract a number from a sentence to use in formula?
    By ocannon1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-22-2017, 07:40 AM
  3. formula to extract number from sttring
    By cmb80 in forum Excel General
    Replies: 2
    Last Post: 04-01-2017, 12:10 AM
  4. [SOLVED] Formula to extract number from a string
    By Bobbbo in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-28-2017, 03:04 AM
  5. [SOLVED] Extract Number from Parenthesis for Use in Formula
    By kellyjo7 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 01-09-2015, 06:48 PM
  6. Formula to extract number only
    By tantcu in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-16-2014, 04:08 PM
  7. [SOLVED] Formula needed to extract number
    By MHamid in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-01-2013, 02:43 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