+ Reply to Thread
Results 1 to 12 of 12

Formula to extract numerical part at the end of text

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Formula to extract numerical part at the end of text

    Hello:

    Please refer to attached file.
    I need to extract numerical part at the end of text in column B in column A.
    Basically need formula in column A to extract numerical part at the end of text.


    Let me know if you have any questions.
    Thanks.

    Riz
    Attached Files Attached Files

  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
    52,939

    Re: Formula to extract numerical part at the end of text

    I am currently unable to open excel files (at work), can you give a few examples here please?
    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 Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,737

    Re: Formula to extract numerical part at the end of text

    Are they always 5 digits (as shown in your example) ?

    If so you could use this:

    =RIGHT(B1,5)+0

    then copy down.

    Hope this helps.

    Pete

  4. #4
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Formula to extract numerical part at the end of text

    Hello:

    No, not necessary that it will have 5 digits.

    Example : BACARDI ANEJO 750ML 28712, here i need to retrive 28712

    99 APPLES 100ML 104099, here i need to get 104099
    99 PEACHES LTR 104283 , 104283

    Please let me know if you have any questions.
    Thanks.

    Riz

  5. #5
    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
    52,939

    Re: Formula to extract numerical part at the end of text

    is there always a comma before the number, and is there always only 1 comma in the string?

  6. #6
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Formula to extract numerical part at the end of text

    Hello:

    I am sorry but it will not have any comma,

    BACARDI ANEJO 750ML 28712
    99 APPLES 100ML 104099
    99 PEACHES LTR 104283

    NO COMMA

    MAY BE BEST IF LAST SPACE character is found and numnerical number after the last space is the answer.

    Thanks

    Riz

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,737

    Re: Formula to extract numerical part at the end of text

    Hi Riz,

    I didn't notice it was you that was posting.

    If the maximum number of digits is 6, you could use this:

    =RIGHT(B1,7-FIND(" ",RIGHT(B1,7)))+0

    Just change the 7 (twice) if the number of digits could be more than 6 (i.e. make it 1+ the largest number of digits).

    Hope this helps.

    Pete

  8. #8
    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
    52,939

    Re: Formula to extract numerical part at the end of text

    Or, count the number of spaces (len()-len(substitute)), replace the last space with, say, @, ID where that is, and mid() from that point

  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 to extract numerical part at the end of text

    Try this
    Enter in A1 and copy down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A B
    1 12372 1800 REPOSADO 1.75 12372
    2 28712 BACARDI ANEJO 750ML 28712
    3 28712 BACARDI ANEJO 750ML 28712
    4 104099 99 APPLES 100ML 104099
    5 104283 99 PEACHES LTR 104283
    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

  10. #10
    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
    52,939

    Re: Formula to extract numerical part at the end of text

    Alkey, nice 1

    Care to explain how that works?

  11. #11
    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 to extract numerical part at the end of text

    Hi Ford,

    There is not much to explaining to do. Simple LOOKUP function.
    =-LOOKUP(1,-RIGHT(B1,COLUMN(1:1))) where COLUMN(1:1) here to replace {1,2,3,4,5,6,and so on} Nothing special

  12. #12
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Formula to extract numerical part at the end of text

    Hello Guys
    Thanks to all but Alkey solution is great.

    Riz

+ 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. extract part of text
    By tushararora in forum Excel General
    Replies: 7
    Last Post: 05-08-2018, 08:02 AM
  2. [SOLVED] Extract Numerical part
    By rizmomin in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 05-09-2014, 09:33 AM
  3. [SOLVED] Extract Numerical part with VB Code
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-28-2014, 05:04 PM
  4. [SOLVED] Extract a numerical value after a text.
    By Ken64 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-24-2013, 02:30 PM
  5. Extract only certain part of text from a cell
    By Dimitripros in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 05-13-2013, 03:05 AM
  6. extract last part of a text string
    By TheShinE in forum Excel General
    Replies: 5
    Last Post: 09-23-2011, 01:02 PM
  7. Extract a part of Text file
    By parasbshah in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-15-2011, 02:55 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