+ Reply to Thread
Results 1 to 18 of 18

Help splitting out multiple pieces of data from 1 cell (various ranges)

  1. #1
    Registered User
    Join Date
    12-26-2012
    Location
    palm harbor, florida
    MS-Off Ver
    Excel 2010
    Posts
    14

    Help splitting out multiple pieces of data from 1 cell (various ranges)

    Excel.jpg

    Hey guys,

    The attached image shows an example of the data in column B that is highlighted in red that I need extrapolated in seperate columns like C, D, E, F and G shown. Main problem I'm having which goes beyond my scope is the name lengths are different sizes and uniquely identifying how to capture each of the highlighted red parts. If you think you can help me I'd greatly appreciate it!

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

    Re: Help splitting out multiple pieces of data from 1 cell (various ranges)

    You can use Data | Text-to-Columns to split the data at the spaces and then delete the columns that you don't need.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    12-26-2012
    Location
    palm harbor, florida
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Help splitting out multiple pieces of data from 1 cell (various ranges)

    Thanks for replying. I thought of doing that, but I'm working with thousands of rows of data, so that would be impractical for me. I used the following formula to extract the names:

    =IFERROR(MID(A2,FIND(" ",A2)+1,FIND("REG",A2)-12),MID(A2,FIND(" ",A2)+1,FIND("OVT",A2)-12))

    but I also need a way to capture the 1st, 2nd and 4th pieces of numerical information in the columns next to the name extraction.

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

    Re: Help splitting out multiple pieces of data from 1 cell (various ranges)

    If you post an example Excel workbook rather than a picture then we might be able to work on some formulae for you - I certainly don't fancy trying to reproduce your example data before being able to play about with it.

    I'm not sure why you say that Text-to-Columns is "impractical" because you have thousands of rows - it's a one-time operation, regardless of the number of rows of data.

    Pete

  5. #5
    Registered User
    Join Date
    12-26-2012
    Location
    palm harbor, florida
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Help splitting out multiple pieces of data from 1 cell (various ranges)

    Hmm I can't see a link to allow me to attach an excel file. Can email it to you if that sufficies.

  6. #6
    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
    53,044

    Re: Help splitting out multiple pieces of data from 1 cell (various ranges)

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

    Also on a side-note, I would have thought that T2C was the perfect tool to use if you have " thousands of rows of data"?
    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

  7. #7
    Registered User
    Join Date
    12-26-2012
    Location
    palm harbor, florida
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Help splitting out multiple pieces of data from 1 cell (various ranges)

    ^ Thank you for the clarifying how to attach. I wouldn't consider myself that savvy with excel, so maybe some of the options you are suggesting will help once you try it on the sample I'm attaching. I was able to on my own extract the name and 1st portion of the numbers I need, but struggling to come up with a way to capture the 2nd and 4th numerical values. Below my extraction is how the data comes out if I try to T2C the data by spaces, which from how I've done it anyway is all over the place :/
    Attached Files Attached Files

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

    Re: Help splitting out multiple pieces of data from 1 cell (various ranges)

    You had attached your picture to post #1, so I assumed you knew how to do it, as it is the same procedure.

    Thanks to FDibbins for the detailed description.

    Pete

  9. #9
    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
    53,044

    Re: Help splitting out multiple pieces of data from 1 cell (various ranges)

    OK I see what you mean, you have additional spaces in some rows

    If its just those 2 columns you want, I will put a formula together for you (if Pete doesnt beat me to it lol)

  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
    53,044

    Re: Help splitting out multiple pieces of data from 1 cell (various ranges)

    Hmm ok, this is not as simple as I thought. You have some names with name,name and others with name name,name name and still others with name,name name name

    This will work on name,name, but not the others...
    =MID(A2,SEARCH(" ",A2,1)+1,SEARCH(" ",A2,SEARCH(" ",A2,1)+1)-SEARCH(" ",A2,1)-1)

    How are you getting the data?

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

    Re: Help splitting out multiple pieces of data from 1 cell (various ranges)

    I must be a bit slow today !!

    I've put the necessary formulae to extract all the required data in the attached file, though some of them don't seem so "elegant" to me..

    Hope this helps.

    Pete
    Attached Files Attached Files

  12. #12
    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
    53,044

    Re: Help splitting out multiple pieces of data from 1 cell (various ranges)

    great catch on the REG and OVT Pete, I saw the REG, but not the OVT, well done

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

    Re: Help splitting out multiple pieces of data from 1 cell (various ranges)

    Quote Originally Posted by FDibbins View Post
    great catch on the REG and OVT Pete, I saw the REG, but not the OVT, well done
    Maybe that's why it took me a bit longer !! <bg>

    Thanks for the rep.

    Pete

  14. #14
    Registered User
    Join Date
    12-26-2012
    Location
    palm harbor, florida
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Help splitting out multiple pieces of data from 1 cell (various ranges)

    I'm not sure if something is going on with the website or I'm behind some firewall or other means since I'm at work, but I'm having trouble viewing your XL attachment. Keeps notifying me log in which I am. That, and the replies posted after I attached my spreadsheet didn't show up until I went to try and edit my post.
    Last edited by avryx; 05-22-2013 at 12:37 PM.

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

    Re: Help splitting out multiple pieces of data from 1 cell (various ranges)

    Yes, it has been very slow for me for the last half-hour or so. I've sent you the file, but you should avoid putting your email address in public forums - why don't you edit it out now that I've responded?

    Pete

  16. #16
    Registered User
    Join Date
    12-26-2012
    Location
    palm harbor, florida
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Help splitting out multiple pieces of data from 1 cell (various ranges)

    Thanks Pete! Astounded and amazed! Going to look at your formulas later to try and make sense of them!

  17. #17
    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
    53,044

    Re: Help splitting out multiple pieces of data from 1 cell (various ranges)

    In case you cant open Pete's file.....
    =MID(A2,12,SEARCH(IF(ISNUMBER(SEARCH(" REG ",A2))," REG "," OVT "),A2)-12)
    and...
    =--LEFT(SUBSTITUTE(RIGHT(A2,LEN(A2)-11),B2&" "&C2&" ",""),SEARCH(" ",SUBSTITUTE(RIGHT(A2,LEN(A2)-11),B2&" "&C2&" ",""))-1)

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

    Re: Help splitting out multiple pieces of data from 1 cell (various ranges)

    A few more words of explanation:

    The double unary minus (--) is used to convert a string representation of a number (which is what you get with MID, RIGHT, LEFT etc.) to a proper number - essentially, it is the same as multiplying by -1 twice.

    Having extracted the name and the type, these can be re-combined with spaces and then used with SUBSTITUTE to remove them from the original string, so that it is then a matter of using LEFT(string,SEARCH(" ",string)-1). This applies to the 3rd and 4th columns, but for the 5th column it is easier to use RIGHT to get the final part of the string.

    Hope this helps.

    Pete

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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