+ Reply to Thread
Results 1 to 8 of 8

Convert some columns to pivot table rows?

  1. #1
    Registered User
    Join Date
    03-27-2015
    Location
    Madison, WI
    MS-Off Ver
    Office 2013
    Posts
    12

    Convert some columns to pivot table rows?

    I'm having an issue figuring out how to display some of my data while retaining the ability to filter on other columns.

    My data is setup as below:
    Date Col1 Col2 Col3 Col4
    1/1/2015 1 2
    1/1/2015 1 1 2
    1/2/2015 1 1 1 3
    1/2/2015 1 1 2
    1/3/2015 1 3

    I would like to be able to display the data in a pivot table, with Col1-Col4 being the rows and then the count and sum of each column being the values, so I could then also filter the data based on the Date column, or any of the other columns in the spread sheet.

    Any help would be greatly appreciated!

  2. #2
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Convert some columns to pivot table rows?

    Hi,

    I have created a Pivot table in the attached file based on the description provided by you, see if it suits your requirement!
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-27-2015
    Location
    Madison, WI
    MS-Off Ver
    Office 2013
    Posts
    12

    Re: Convert some columns to pivot table rows?

    Thanks for putting that together cbatrody, unfortunately it's not quite what I am looking for. My data is going to have anywhere from 4 to 20 columns that will need to be on the pivot table, and I'd like to make it as easy to see the data as possible.

    I envision the resulting pivot table looking like this:

    Column_Name Count Sum
    Col1
    Col2
    Col3
    Col4
    Grand Total

    With the ability to then add filters to the pivot table based on other columns in the worksheet.

    I currently manipulate the data with macros to then create a pivot table as presented in the table above, but to do this I have to change the format of the data, eliminating the connection to other columns, thus eliminating the ability to filter.

    I'm not sure if what I am looking for is possible without manipulating the data at the start.

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Convert some columns to pivot table rows?

    See the attached file (the sheet output).

    A pivot table, after re-arrange the data with a macro.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  5. #5
    Registered User
    Join Date
    03-27-2015
    Location
    Madison, WI
    MS-Off Ver
    Office 2013
    Posts
    12

    Re: Convert some columns to pivot table rows?

    Thanks for that oeldere, the resulting pivot table is what I am looking for, but the method of converting the data unfortunately won't work for what I am doing. There will potentially be as many as 20 columns to handle, and breaking each row down to 20 rows would mean it wouldn't work on any spreadsheet with 50,000 or more rows. Which will be fairly common for my data sets.

    It looks like I'll probably have to move the data to Access to be able to do what I'd like to do efficiently. Thanks for the help all!

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Convert some columns to pivot table rows?

    but the method of converting the data unfortunately won't work

    Did you test it?

    If yes, what is the result?

  7. #7
    Registered User
    Join Date
    03-27-2015
    Location
    Madison, WI
    MS-Off Ver
    Office 2013
    Posts
    12

    Re: Convert some columns to pivot table rows?

    I did test the macro, Excel stopped responding for a while and eventually spit out a 1004 error on the macro, due to range in _Worksheet.

    The issue is that Excel can only handle a little over a million rows, and when dealing with 20 columns and 100,000 rows, the macro errors out when it hits Excel's limit.

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Convert some columns to pivot table rows?

    Thanks for the reply.

+ 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. [SOLVED] Cant convert Pivot Rows into Columns
    By chris8877 in forum Excel Charting & Pivots
    Replies: 14
    Last Post: 12-13-2012, 09:33 AM
  2. Replies: 1
    Last Post: 11-29-2012, 06:24 PM
  3. Replies: 2
    Last Post: 07-06-2012, 02:38 PM
  4. Hiding Rows or Columns in a Pivot Table
    By ani4ani in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 11-21-2007, 05:42 PM
  5. Too many rows or columns in my pivot-table
    By markus in forum Excel General
    Replies: 1
    Last Post: 08-14-2006, 10:00 AM

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