+ Reply to Thread
Results 1 to 9 of 9

Looking to separate and duplicate rows based on values in one column.

  1. #1
    Registered User
    Join Date
    11-24-2014
    Location
    Southern California
    MS-Off Ver
    MS Office 365
    Posts
    5

    Question Looking to separate and duplicate rows based on values in one column.

    Looking to separate and duplicate rows based on values in one column.

    I have a poorly formatted spreadsheet whereby first names for different family members were all included in one cell. The rest of the data in the row is fine... only the first name cell was combined.

    Something like...

    John,Jane,Charlie,Shirly

    and others like...

    Frank and Mindy

    I need to duplicate the entire row of data for all cells in this column that have multiple names in this first name field. The rest of the cells in the row such as last name, phone, address, etc... will need to to stay the same and also be duplicated to any new rows created. Please see attached image as it hopefully will help.

    What I need is these names to each appear on their own row but maintain the data of the rest of the cells in that row.
    Attached Images Attached Images

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Looking to separate and duplicate rows based on values in one column.

    I can't see the image on my PC. However, two Qs...

    Do the comma separated names also contain spaces? If so - where?
    Are two-name entries ALWAYS XXXXX and YYYYY; or are other variants possible. It might help if you were to attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    11-24-2014
    Location
    Southern California
    MS-Off Ver
    MS Office 365
    Posts
    5

    Re: Looking to separate and duplicate rows based on values in one column.

    Hmmm. I'm not sure why you can't see the image. It does show up for me.

    Here is a direct link to the example.

    http://www.pixogee.com/images/example_help.png

    In answer to your question, sometimes there is a space and the word 'and' and sometimes just commas. The example image should hopefully explain it better.

  4. #4
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Looking to separate and duplicate rows based on values in one column.

    Please Login or Register  to view this content.
    If someone has helped you then please add to their Reputation

  5. #5
    Registered User
    Join Date
    11-24-2014
    Location
    Southern California
    MS-Off Ver
    MS Office 365
    Posts
    5

    Re: Looking to separate and duplicate rows based on values in one column.

    Appreciate the quick responses here! @pjwhitfield - Super close to what I need. I ran it and the cells that contain first names like John and Jane are separated but Jane ends up with a single space in front of her first name on her row.

  6. #6
    Registered User
    Join Date
    11-24-2014
    Location
    Southern California
    MS-Off Ver
    MS Office 365
    Posts
    5

    Re: Looking to separate and duplicate rows based on values in one column.

    Thanks pjwhitfield. All I needed to do was add a space after the and...

    Please Login or Register  to view this content.
    That worked! Again, thanks so much!

  7. #7
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Looking to separate and duplicate rows based on values in one column.

    A more ideal solution though (and what i should have coded originally) is to TRIM excess spaces before outputting the forename, that way any rogue double spaces etc are removed as well. However your spaces around and are important (and should include one before in order to ensure correct results where "andrea", "andrew", "andreas" etc exist.

    replace
    Please Login or Register  to view this content.
    with
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    11-24-2014
    Location
    Southern California
    MS-Off Ver
    MS Office 365
    Posts
    5

    Re: Looking to separate and duplicate rows based on values in one column.

    Ah! Very good! Thanks pjwhitfield! This was very helpful and obviously saved me gobs of time!

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Looking to separate and duplicate rows based on values in one column.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

+ 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. Combine rows with duplicate values into separate columns
    By itgeekgroup in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-18-2014, 11:12 AM
  2. how to filter the rows based on a column which contains duplicate values...
    By Rajesh Ushakoyyala in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-04-2013, 10:49 AM
  3. Cut & paste rows based on duplicate column values
    By agolden7 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-26-2013, 11:09 AM
  4. Remove rows with duplicate values in one column based on value of another column
    By jolleyje in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-15-2013, 06:20 AM
  5. Find duplicate values based on 2 separate columns
    By dreich in forum Excel General
    Replies: 1
    Last Post: 01-30-2013, 01:41 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