+ Reply to Thread
Results 1 to 5 of 5

Extract numeric value from the text string

  1. #1
    Registered User
    Join Date
    07-17-2013
    Location
    Hyderabad, India
    MS-Off Ver
    office 365
    Posts
    51

    Extract numeric value from the text string

    Dear Experts,

    I have a file containing text string of 500 rows. Out of which, I have to extract only the numeric value that appears after a particular text.

    Ex:

    CMP00000000381181704AOE1975372 TRANSFER TO 33164290629 - I want to extract only numeric value appearing after "TRANSFER TO".

    I have used FIND function and tried to extract the number. Only concern for me was all the text strings are not constant. They have other values before and after the numeric value.

    Request you to please help me find a solution.

    Attaching a file with sample text string for your reference.
    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,938

    Re: Extract numeric value from the text string

    A little bit long winded, but try...
    =IFERROR(LEFT(MID(B2,SEARCH("to",B2)+3,99),FIND("/",MID(B2,SEARCH("to",B2)+3,99))-2),MID(B2,SEARCH("to",B2)+3,99))
    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 Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Extract numeric value from the text string

    Using MID to extract multi values, starts from FIND+12 (12 is lenght of "TRANSFER TO"), with 1,2,3,...,15 digits (3;33;331;3316;..,33164290629), then get the max (with AGGREGATE(14,6,...,1))

    =AGGREGATE(14,6,--MID(B2,FIND("TRANSFER TO",B2)+12,ROW($1:$15)),1)
    Quang PT

  4. #4
    Registered User
    Join Date
    07-17-2013
    Location
    Hyderabad, India
    MS-Off Ver
    office 365
    Posts
    51

    Re: Extract numeric value from the text string

    Thank you both FDibbins and bebo021999 for your valuable functions.

    Since, both the formulas have multiple functions combined have to practice and try to memorise them for future use.

  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,938

    Re: Extract numeric value from the text string

    Happy to help and thanks for the feedback

+ 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 numeric values from the string
    By ABSTRAKTUS in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-02-2020, 06:38 AM
  2. Extract Numeric from a String
    By wlteo1983 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-17-2014, 06:05 AM
  3. [SOLVED] Extract numeric part of string
    By excelaron in forum Excel General
    Replies: 7
    Last Post: 08-28-2012, 03:54 PM
  4. [SOLVED] Extract a mainly numeric string (ISSN number) from an arbitrary string
    By Buzzed Aldrin in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 07-04-2012, 01:49 PM
  5. Extract numeric value from a string of unknowns
    By Rick_Stanich in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-01-2010, 12:00 PM
  6. Extract numeric and char from string!
    By aywen in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-16-2007, 11:39 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