+ Reply to Thread
Results 1 to 8 of 8

Extract numbers after a specific text from a text string

  1. #1
    Registered User
    Join Date
    04-23-2019
    Location
    Mexico
    MS-Off Ver
    2013
    Posts
    2

    Extract numbers after a specific text from a text string

    Hello!

    Thank you in advance for all the support, I'm wondering if you could help me with an approach to this:

    10003|TRUE|[{*day*:*mon*,*amount*:3463.98},{*nig*:*tue*,*amount*:77.09}]

    I have a column of data that looks like this, all of the above is in the same cell, I need to extract the numbers, i.e. 3463.98 in one cell and 77.09 in a different cell.

    Does anyone have any idea of which formula I can use? I've tried with a combination left, mid, find, etc but I haven't found any success.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Extract numbers after a specific text from a text string

    Are the numbers always in the same position? Is a user-defined function OK?

    A
    B
    2
    10003|TRUE|[{*day*:*mon*,*amount*:3463.98},{*nig*:*tue*,*amount*:77.09}]
    3
    3463.98
    A3: =--MidWd(SUBSTITUTE(A2, "}", ":"), 2, 1, ":")
    4
    77.09
    A4: =--MidWd(SUBSTITUTE(A2, "}", ":"), 5, 1, ":")
    Entia non sunt multiplicanda sine necessitate

  3. #3
    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: Extract numbers after a specific text from a text string

    1. Enter formula in B2

    =TRIM(MID(SUBSTITUTE(SUBSTITUTE(A2,"}",":"),":",REPT(" ",99)),99*2,99))/1

    2. Enter formula in C2

    =TRIM(MID(SUBSTITUTE(SUBSTITUTE(A2,"}",":"),":",REPT(" ",99)),99*5,99))/1

    v A B C
    1
    2 10003|TRUE|[{*day*:*mon*,*amount*:3463.98},{*nig*:*tue*,*amount*:77.09}] 3463.98 77.09
    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

  4. #4
    Forum Contributor
    Join Date
    10-30-2003
    Location
    Singapore
    MS-Off Ver
    Excel 2019
    Posts
    197

    Re: Extract numbers after a specific text from a text string

    1] Data put in cell A1

    2] B1, formula copied across right until blank :

    =IFERROR(LOOKUP(9^9,--MID($A1,FIND("@",SUBSTITUTE($A1,"*amount*:","@",COLUMN(A1)))+9,ROW($1:$99))),"")

    p.s. can extract all numbers behind specified text "amount".

    Regards
    Bosco
    Last edited by Bosco; 04-23-2019 at 12:57 PM.

  5. #5
    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: Extract numbers after a specific text from a text string

    Here is another one with a single formula
    Drag formula across

    =MID(SUBSTITUTE(SUBSTITUTE($A1,"}",":"),":",REPT(" ",99)),99*INDEX({2,5},COLUMNS($A:A)),99)/1
    Last edited by AlKey; 04-23-2019 at 12:51 PM.

  6. #6
    Registered User
    Join Date
    04-23-2019
    Location
    Mexico
    MS-Off Ver
    2013
    Posts
    2

    Re: Extract numbers after a specific text from a text string

    This one works great, just one question, if a cell reads:
    10007|TRUE|[{*currency*:*USD*,*amount*:14824.98},{*currency*:*ZEC*,*amount*:0},{*currency*:*XRP*,*amount*:0},{*currency*:*LTC*,*amount*:1},{*currency*:*ETH*,*amount*:0.7},{*currency*:*BTC*,*amount*:0},{*currency*:*DASH*,*amount*:0.093602},{*currency*:*ETC*,*amount*:0},{*currency*:*XMR*,*amount*:0}]

    Meaning I can get the value for the first and second amounts, how would you get the value of the other amounts, i.e. instead of 2 and then 5, what would be the numbers?

  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: Extract numbers after a specific text from a text string

    As I understand, the string is in A1 and the values need to be extracted in columns:
    Enter formula in B1 and drag across until you see blanks
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A B C D E F G H I J K
    1 10007|TRUE|[{*currency*:*USD*,*amount*:14824.98},{*currency*:*ZEC*,*amount*:0},{*currency*:*XRP*,*amount*:0},{*currency*:*LTC*,*amount*:1},{*currency*:*ETH*,*amount*:0.7},{*currency*:*BTC*,*amount*:0},{*currency*:*DASH*,*amount*:0.093602},{*currency*:*ETC*,*amount*:0},{*currency*:*XMR*,*amount*:0}] 14824.98 0 0 1 0.7 0 0.093602 0 0

  8. #8
    Forum Contributor
    Join Date
    10-30-2003
    Location
    Singapore
    MS-Off Ver
    Excel 2019
    Posts
    197

    Re: Extract numbers after a specific text from a text string

    Another drag across formula :

    =IFERROR(0+TRIM(MID(SUBSTITUTE(SUBSTITUTE("}"&$A1,"t*:","}"),"}",REPT(" ",300)),COLUMN(A1)*600,300)),"")

    Regards
    Bosco

+ 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 specific text within a text string
    By raza_m33hdy in forum Excel General
    Replies: 5
    Last Post: 04-16-2018, 09:59 AM
  2. Extract Specific Text From String
    By dawsexcel in forum Excel General
    Replies: 3
    Last Post: 07-13-2016, 01:44 PM
  3. Extract Several Numbers From Text String
    By mvl3589 in forum Excel General
    Replies: 5
    Last Post: 06-21-2016, 08:11 PM
  4. Extract specific numbers from a string of text
    By Galwaygirl13 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-19-2012, 03:22 PM
  5. Replies: 5
    Last Post: 05-03-2011, 09:35 AM
  6. Extract numbers from text string
    By mkvassh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-24-2009, 08:53 AM
  7. [SOLVED] EXTRACT NUMBERS FROM TEXT STRING
    By fiber_doc in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-28-2005, 02:45 PM

Tags for this Thread

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