+ Reply to Thread
Results 1 to 10 of 10

Need help extracting data from text

  1. #1
    Registered User
    Join Date
    01-10-2013
    Location
    Cardiff, CA
    MS-Off Ver
    Excel 16.49 for Mac
    Posts
    15

    Need help extracting data from text

    I have been humbled (once again) by Excel! I am running tests on prototypes of a new fitness device. As part of our tests, we collect data from an accelerometer. I receive the data in this format: {X,Y,Z}. I can transfer the data from our test fixture to an Excel file - see attached as an example.

    The accelerometer data are in column D. I want to extract the X, Y and Z values and put them in columns E, F and G. I tried using the MID function to extract the data, but that didn't work because the length of the data varies. For example, it could be a single-digit number (such as 5). Or it could be a two-digit number (such as 17 or -8). It could be a three-digit number (such as -21). In rare cases, it could be a three-digit positive number (such as 126) or a four-digit negative number (such as -208).

    With thanks in advance, does anybody have any suggestions for extracting the values of X, Y and Z and placing them in separate columns?

    Cheers,
    Clint

  2. #2
    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: Need help extracting data from text

    Copy and paste this formula in E1 and drag to the right

    =TRIM(MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE($D1,"{",""),"}",""),"/",REPT(" ",LEN($D1))),(COLUMNS($B:B)-1)*LEN($D1)+1,LEN($D1)))
    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

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Need help extracting data from text

    Hi Clint0

    Try this
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Registered User
    Join Date
    01-10-2013
    Location
    Cardiff, CA
    MS-Off Ver
    Excel 16.49 for Mac
    Posts
    15

    Re: Need help extracting data from text

    In response to AlKey: That works beautifully - thanks.

    One follow up question. There is a little green flag in the upper left corner of every cell - warning me that the formula refers to empty cells. Is there a way to get rid of all of those little green flags all at once? Or do I need to click on each cell individually and then click on the instruction to ignore the error?

    (BTW, I am using Excel for Macintosh 2011, version 14.3.9)

    John: I will reply separately to you post - thanks to you too.

    Clint
    Last edited by ClintO; 02-26-2014 at 02:59 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: Need help extracting data from text

    To get rid of those just select all cells and then click on the little box and select Ignore.



    You're welcome and thank you for your feedback!

    Please mark thread as "Solved" if your issue has been resolved. (Selecting Thread Tools-> Mark thread as Solved).

  6. #6
    Registered User
    Join Date
    01-10-2013
    Location
    Cardiff, CA
    MS-Off Ver
    Excel 16.49 for Mac
    Posts
    15

    Re: Need help extracting data from text

    Hi John -
    Thanks for the reply. Should I copy and paste that code into cell D1 on my worksheet? (Will this code work in Excel for Macintosh 2011?)

    Cheers,
    Clint

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Need help extracting data from text

    Hi Clint

    Will it run on a Mac...don't know...press Ctrl + x and see if it works.

    The Code goes in a General Module. Go into VBA (Alt + F11).

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need help extracting data from text

    I am not sure if the code works on Mac, but try to press the button on Column K.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    01-10-2013
    Location
    Cardiff, CA
    MS-Off Ver
    Excel 16.49 for Mac
    Posts
    15

    SOLVED: Need help extracting data from text

    That did the trick - thanks! I am looking for where to mark the thread as solved. (John - thanks for your input also. I'll make the plunge into VBA at a some future date.)

  10. #10
    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: Need help extracting data from text

    Please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. extracting data based on text
    By nobodytwok in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-15-2013, 09:43 AM
  2. Extracting data from this text format
    By teachme in forum Excel General
    Replies: 17
    Last Post: 08-21-2008, 12:55 AM
  3. Extracting strings of text from Columns of data(text)
    By welshmagic69 in forum Excel General
    Replies: 9
    Last Post: 04-23-2007, 02:50 PM
  4. [SOLVED] Extracting Text Data to Excel
    By Ozzie via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-02-2006, 01:35 PM
  5. [SOLVED] extracting text data in a cell
    By gareth1983 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-06-2005, 12:05 AM

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