Results 1 to 7 of 7

Thread: How to tranpose 2 column excel spreadsheet by column A group

  1. #1

    How to tranpose 2 column excel spreadsheet by column A group



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Firstly, apologies if this has been asked before but I have been trawling the site for half an hour and haven't found a solution to the question I'm asking. Some of the questions are close but I haven't been able to apply the answers to this issue.

    In a nutshell, I have two columns of data in a spreadsheet, column A are the "groups" and column B is a list of names. I would like to transpose the data, grouping by column A, as follows.

    CURRENT LAYOUT

    C-- Steve
    A-- James
    A-- Alex
    B-- Sarah
    D-- David
    A-- Joanna
    D-- Colin
    A-- Brian
    D-- Peter
    E-- Sally

    DESIRED LAYOUT

    A-- James-- Alex-- Joanna--Brian

    B-- Sarah

    C-- Steve

    D-- David-- Colin-- Peter

    E-- Sally


    I've been trying to use a pivot table but it won't allow to me output the data in this way (or perhaps I've missed something?).

  2. #2
    Super Moderator JeffreyWeir's Avatar
    Join Date
    Mar 2011
    Location
    New Zealand
    Posts
    357
    Articles
    0
    Book4.xlsx See attached. Yes, you can do with with a pivot. You just need to create a pivot (preferably turn your datasource into an Excel Table with the Ctrl T shortcut first, so that the pivot always points to the data even if you add new rows), then drag the column with letters into the ROWS field, drag the ones with Names into the ROWS field also, turn off subtotals, and select 'Show in Tabular form' from PivotTable Tools>Design Tab> Report Layout

    See attached.

  3. #3
    Thanks for getting back to me, really appreciate it!

    This isn't quite what I was after unfortunately. I got this far with the pivot table method but I need to be able to display the different groups (i.e grades) as rows with one row per grade and with names as columns. To illustrate this better, I'd like to be able to display this....

    Grade Name
    A Alex
    Brian
    James
    Joanna
    B Sarah
    C Steve
    D Colin
    David
    Peter
    E Sally
    as this
    Grade Name
    A Alex Brian James Joanna
    B Sarah
    C Steve
    D Colin David Peter
    E Sally

  4. #4

  5. #5
    Super Moderator JeffreyWeir's Avatar
    Join Date
    Mar 2011
    Location
    New Zealand
    Posts
    357
    Articles
    0
    Nice approach, herbds7. I completely misunderstood this question sorry, kowalski_ldn

    Now that I get it, I'd propose this formula:=IFERROR(INDEX(INDEX(Table1[Name],MATCH([@Grade],Table1[Grade],FALSE)):INDEX(Table1[Name],MATCH([@Grade],Table1[Grade],TRUE)),Table2[[#Headers],[1]:[10]]),"")...entered into the same table that herbds7 used with his approach. Good thing about this is that it doesn't require any intermediate columns. Only works if your data is sorted by Grade (as it is in your example).

    See attached: Formula crosstab from sorted data 20130629.xlsb

  6. #6
    Sorry for the delayed reply and many thanks for your help. This has really helped me out!

  7. #7
    Super Moderator JeffreyWeir's Avatar
    Join Date
    Mar 2011
    Location
    New Zealand
    Posts
    357
    Articles
    0
    Thanks for letting us know. See you back again soon :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •