+ Reply to Thread
Results 1 to 3 of 3

Difficulty with finding value after text in a cell and copy to next column

  1. #1
    Registered User
    Join Date
    08-28-2018
    Location
    Canada
    MS-Off Ver
    Latest
    Posts
    1

    Difficulty with finding value after text in a cell and copy to next column

    Hello,

    I have various excel files with hundred of thousands of lines from which I am trying to extract data from a very long text string to paste it in the next column.

    For the record, here's what the cell look like :

    Please Login or Register  to view this content.
    Those are basically trade data between 2 assets, the 1.3.1570 and the 1.3.3467 and are switching position depending on if it was a buy or a sale.

    I'm trying to get the amount of each asset copy/pasted in the next corresponding cell. For example, row B should represent the quantity of 1.3.1517 and row C the one for 1.3.3467
    How do I extract those number coming after the "pays":{"amount":" ? I've tried basic solution other post made but the quotation mark got the best out of me. I'd also need the result as a numeric value so that I can do further maths with it. I also am looking at having the result either positive or negative depending on if it was a "pays" or "receives"

    Many thanks all!
    Last edited by Aisling 5C; 08-28-2018 at 11:43 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    02-04-2009
    Location
    Texas
    MS-Off Ver
    Excel 2016
    Posts
    665

    Re: Difficulty with finding value after text in a cell and copy to next column

    IF the data is in COlumn B (starting at B2)
    And you need the info in column C (C2)
    Add this to C2 =MID($B2,SEARCH("pays",$B2)+17,(SEARCH("Asset_ID",$B2,SEARCH("pays",$B2)+17)-3)-(SEARCH("pays",$B2)+17))

    the 17 represents count of spaces between A In Asst ID to the first number so it needs to be pretty uniform information.

    You can surround the formula with Value()
    =VALUE(MID($B2,SEARCH("pays",$B2)+17,(SEARCH("Asset_ID",$B2,SEARCH("pays",$B2)+17)-3)-(SEARCH("pays",$B2)+17)))

  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: Difficulty with finding value after text in a cell and copy to next column

    To get "Pays" value:
    Enter formula in cell B2
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    To get these values: 1.3.1570 and 1.3.3467
    Enter formula in cell C2 and drag formula across
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    A
    B
    C
    D
    E
    F
    1
    Text string Pays
    2
    [4,{"fee":{"amount":6823,"asset_id":"1.3.1570"},"order_id":"1.7.182934669","account_id":"1.2.766653","pays":{"amount":"13275511063","asset_id":"1.3.3467"},"receives":{"amount":3411806,"asset_id":"1.3.1570"},"fill_price":{"base":{"amount":"31060158767","asset_id":"1.3.3467"},"quote":{"amount":7982460,"asset_id":"1.3.1570"}},"is_maker":true}]
    13275511063
    1.3.1570
    1.3.3467
    1.3.1570
    1.3.3467
    Sheet: Sheet1
    Attached Files Attached Files
    Last edited by AlKey; 08-28-2018 at 01:05 PM.
    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

+ 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] Search a column for a value and if it exists copy text from corresponding cell in column A
    By badlydrunkboy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-02-2014, 06:13 AM
  2. [SOLVED] Finding the sum of values in a column relative to text in the corresponding cell.
    By greaseebogus in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-25-2014, 10:13 PM
  3. Replies: 1
    Last Post: 12-10-2013, 05:23 PM
  4. [SOLVED] IF column = specific text then copy value from another cell along the same column
    By Lifeless in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-02-2013, 04:15 PM
  5. Long rows of data and have difficulty finding a concise solution for a report
    By vbhal in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-04-2011, 11:34 AM
  6. difficulty writing code for changing font color if cell contains specific text
    By curbster in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 08-13-2009, 03:23 AM
  7. Finding last cell in a column, select, copy/paste
    By GaretJjax in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-16-2008, 05:17 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