+ Reply to Thread
Results 1 to 3 of 3

Pivot table/transposing columns

  1. #1
    Registered User
    Join Date
    03-09-2009
    Location
    Wilmington, NC
    MS-Off Ver
    Excel 2003
    Posts
    2

    Pivot table/transposing columns

    Hi,

    I need to transpose some data from columns to rows, it is not easy to explain in words what I want do so I have put an example below and see attached file:

    The data is currently in the following format(two headers are col. A = Site and col. B = Cell ID):


    SITE - Cell ID
    312P0011A - 50112
    312P0011A - 50151
    312P0011A - 50052
    312P0011A - 50153
    312P0011A - 51881
    312P0011A - 50152
    312P0052A - 10411
    312P0052A - 51881
    312P0052A - 51673
    312P0052A - 51672
    312P0122A - 50052
    312P0122A - 51803
    312P0122A - 51223
    312P0122A - 51222

    The output I want is as follows:

    SITE Cell ID
    312P0011A 50112 50151 50052 50153 51881 50152
    312P0052A 10411 51881 51673 51672
    312P0122A 50052 51803 51223 51222

    So basically I have compiled a row for each of the entries in column A (Sites).

    I need to do this on a lot of data and wondered if there is a quick way of doing this, it seems to be a mix of transposing the data and pivot table, but no matter what I try I can't get the right results.

    Any help would be greatly appreciated.
    Thanks!
    Attached Images Attached Images
    Last edited by cooter_slackjaw; 03-10-2009 at 10:38 AM.

  2. #2
    Forum Contributor
    Join Date
    01-11-2004
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    388

    Re: Pivot table/transposing columns help?

    Hi!

    This is not the most elegant of solutions (VBA would probably be).

    Select the table and create a pivot table with SITE and CellID as row headings and Count of CellID as the Value.
    This generates a table like this:

    Please Login or Register  to view this content.
    The first column of this pivot table really has what you are looking for, but not in quite the right format.
    Make a copy of this first column and put it (pastespecial/format followed by pastespecial/values) somewhere convenient such as another worksheet.
    You can now extract each subgroup of data (manually, I'm afraid) with its Site and associated Cell IDs. Copy each such set and pastespecial/transpose somewhere suitable.

    Clunky, but it works.

    Alf

  3. #3
    Registered User
    Join Date
    05-27-2011
    Location
    mysore
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Pivot table/transposing columns help?

    Hi Cooter,

    Please try this below code..

    Please Login or Register  to view this content.
    Last edited by arlu1201; 09-25-2012 at 07:00 AM. Reason: Plz put code tags in future.

+ 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