+ Reply to Thread
Results 1 to 6 of 6

Duplicate Entries in Rows - Add Accompanying Data to New Columns

  1. #1
    Forum Contributor
    Join Date
    05-24-2012
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2007
    Posts
    113

    Duplicate Entries in Rows - Add Accompanying Data to New Columns

    I have attached a before and after image of what I am looking to accomplish.

    In the before image, you can see that there are 3 rows of data
    - a header
    - a repeating model number (in column F) with accompanying data (values in columns G - J are the items of interest)

    In the after image, you can see that I took the 3 rows of data and turned it into simply two rows of data
    - a header
    - the repeating model number

    What I did however in the after image, as can be seen, is I took the data that appeared on the repeating row (Row 3 from the Before image), and included the PRICE, COST, BEGIN, and END values in new columns on row 2.

    The model number is the same of course, which is why I did it that way.

    If the model numbers were different, I would have simply left it alone, as-is.


    Is there a way to accomplish this via some functions or maybe even a VBA script?

    By the way, if we have to dump all of this onto a new sheet, then so be it.


    Thanks in advance!
    Attached Images Attached Images

  2. #2
    Forum Contributor
    Join Date
    05-24-2012
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2007
    Posts
    113

    Re: Duplicate Entries in Rows - Add Accompanying Data to New Columns

    If it helps.
    The attached file contains a before and after sheet of what Im looking to achieve,

    Essentially, for any Model number that appears on more than 1 row,
    take the DOC, PRICE, BEGIN, and END values from those rows and append them to the first (instance) row where that Model number appears in new columns.

    Consequently, those rows where the model number repeats should be deleted, since the data for those rows should be merged onto the row containing the first instance of that model number.

    Hopefully, all of the results can fall onto a new sheet.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    05-17-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: Duplicate Entries in Rows - Add Accompanying Data to New Columns

    Did you try the Pivot Table Option

    Select all the cells in Before Sheet >> Insert Tab >> Pivot Table >> On the Row Lables check off Begin (or End if you like that way), in the Column Labels check off End (or Begin in this case if you selected End previously) >> in the Value field you select the Docs

    Once the table is set, change the value field settings from sum to Max

    HTH

  4. #4
    Registered User
    Join Date
    01-28-2012
    Location
    Belarus
    MS-Off Ver
    Excel 2013
    Posts
    12

    Re: Duplicate Entries in Rows - Add Accompanying Data to New Columns

    Hello hamidxa,
    Is it a one-time task or do you need to do this regularly?

  5. #5
    Forum Contributor
    Join Date
    05-24-2012
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2007
    Posts
    113

    Re: Duplicate Entries in Rows - Add Accompanying Data to New Columns

    Quote Originally Posted by jubiesxl View Post
    Did you try the Pivot Table Option

    Select all the cells in Before Sheet >> Insert Tab >> Pivot Table >> On the Row Lables check off Begin (or End if you like that way), in the Column Labels check off End (or Begin in this case if you selected End previously) >> in the Value field you select the Docs

    Once the table is set, change the value field settings from sum to Max

    HTH
    I had originally performed this task with a Pivot Table, but the output didn't look "clean" for lack of a better term.

  6. #6
    Forum Contributor
    Join Date
    05-24-2012
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2007
    Posts
    113

    Re: Duplicate Entries in Rows - Add Accompanying Data to New Columns

    Quote Originally Posted by Alexander Frolov View Post
    Hello hamidxa,
    Is it a one-time task or do you need to do this regularly?
    It's to be a repeated task.

    I found a solution that does the trick for me.

    Here is the code that I used for my specific case (by manipulating the Range values; i.e., I set mine to (r,7) and (r-1, 11))

    Please Login or Register  to view this content.

+ 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