Closed Thread
Results 1 to 13 of 13

transpose duplicate rows to columns

  1. #1
    Registered User
    Join Date
    03-18-2009
    Location
    Stockholm
    MS-Off Ver
    Excel 2003
    Posts
    2

    transpose duplicate rows to columns

    Hi!

    I have Excel 2007 and a two column lexicon in the following format:

    word1 ; word_a
    word1 ; word_b
    word2 ; word_c
    word2 ; word_d
    word2 ; word_e
    word3 ; word_f

    would it somehow be possible to transpose it to:

    word1 ; word_a ; word_b
    word2 ; word_c ; word_d ; word_e
    word3 ; word_f


    I am really not very good at Excel and would greatly appreciate any help!
    /J
    Attached Files Attached Files
    Last edited by slabbbe; 03-19-2009 at 07:57 PM.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: transpose duplicates rows to columns

    Here is one approach:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-16-2009
    Location
    Your mom's basement
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: transpose duplicates rows to columns

    Wow stephen...yours is much fancier than mine...I've never used the scripting dictionary before...

    Here's my brute force solution.

    I'm not sure what row and column to start from, as I have excel 2003 and couldn't open your example....but they are indicated.

    Please Login or Register  to view this content.
    looks messy...too many comments...

  4. #4
    Registered User
    Join Date
    03-18-2009
    Location
    Stockholm
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: transpose duplicate rows to columns

    StephenR, Nomel... thank you so much! So quick answers and your scripts works perfect. I am totally astound!

    Compared, I believe StephenR:s script is a bit faster

    ... anyway, a BIG thanks to both of you!

    /J

  5. #5
    Registered User
    Join Date
    09-03-2011
    Location
    Col, Slovenia
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: transpose duplicate rows to columns

    The first code is much faster but it is not working with my data. something got mixed up.

    The second code is working OK, but I prefer that it not delete - overwrite my data.

    Thanks to both of you anway.

    Here is sample of my data...
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    04-15-2012
    Location
    Amsterdam
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: transpose duplicate rows to columns

    * bump *

    Hi all,

    I face a similar problem as the topic starter, yet somewhat more extensive.
    Let me illustrate: I have Excel 2007 and a thirty column lexicon in the following format:

    word1 ; word_a ; value 1 ; etc.
    word1 ; word_b ; value 2 ; etc.
    word2 ; word_c ; value 2 ; etc.
    word2 ; word_d ; value 3 ; etc.
    word2 ; word_e ; value 4 ; etc.
    word3 ; word_f ; value 1 ; etc.

    would it somehow be possible to transpose it to:

    word1 ; word_a ; value 1 ; etc. for the full row; word_b ; value 2 ; etc. for the full row
    word2 ; word_c ; value 2 ; etc ; word_d ; value 3 ; etc. ; word_e ; value 4 ; etc
    word3 ; word_f ; value 1 ; etc

    I used the provided macro's by StephenR and Nomel. Very helpful, in particular StephenR's one because I don't want it to overwrite my data.

    However, the macro gives the solution only for a single adhering column and not my full range of columns. I'm a real novice, does anyone know what to adjust or add to the macro to take into account the entire range of columns and gives me the solution I want?

    Hope my explanation is clear. Thanks in advance for your help, appreciate every suggestion.

    Best,
    Sander

  7. #7
    Registered User
    Join Date
    04-15-2012
    Location
    Amsterdam
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: transpose duplicate rows to columns

    My apologies, noticed that my problem is already solved in this thread:
    http://www.excelforum.com/excel-prog...o-columns.html
    Figured it could be helpful for future reference.

    Thanks for the excellent knowledge base this forum provides, keep up the good work!

    Sorry for the inconvenience.

    S.

  8. #8
    Registered User
    Join Date
    05-23-2012
    Location
    new york, usa
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: transpose duplicates rows to columns

    Quote Originally Posted by StephenR View Post
    Here is one approach:
    Please Login or Register  to view this content.


    Can you help me with my file that I want to transpose multiple rows into one single row.
    I have the files attached.

    Thank you.
    Attached Files Attached Files
    Last edited by prettysmart; 05-23-2012 at 03:02 PM.

  9. #9
    Registered User
    Join Date
    10-15-2014
    Location
    Los Angeles
    MS-Off Ver
    2010
    Posts
    3

    Re: transpose duplicate rows to columns

    How do you put the rows into separate columns instead of one column separated by commas?

  10. #10
    Registered User
    Join Date
    11-13-2014
    Location
    San Francisco
    MS-Off Ver
    2013
    Posts
    1

    Re: transpose duplicate rows to columns

    From here you can do text to columns to keep them in the same row but different columns.

  11. #11
    Registered User
    Join Date
    03-17-2015
    Location
    NH
    MS-Off Ver
    2007
    Posts
    1

    Re: transpose duplicate rows to columns

    Awesome, was looking all over for this solution, thanks! I've never used a script before, but it does work. I assume there's no function/formula to do this instead?

  12. #12
    Registered User
    Join Date
    03-01-2021
    Location
    United States
    MS-Off Ver
    2101
    Posts
    6

    Re: transpose duplicate rows to columns

    I'm struggling to figure out this same thing. When I looked at the "transpose_duplicates_example2" it showed an example of what I'm looking for, but I still don't understand what I need to do to accomplish it. I'm not sure if I missed something in the thread or not. I hate to open a new thread if not necessary. Thanks for any help you can provide.

  13. #13
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: transpose duplicate rows to columns

    @BJXcelAdministrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

Closed Thread

Thread Information

Users Browsing this Thread

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

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