+ Reply to Thread
Results 1 to 7 of 7

Converting a table to a Pivotable?

  1. #1
    Registered User
    Join Date
    02-15-2017
    Location
    America
    MS-Off Ver
    2010 and 2016
    Posts
    5

    Converting a table to a Pivotable?

    I have some data that I am consolidating from other locations within my organization. Something like this:


    Month |Customer| Issue 1 | Issue 2 | Issue 3 | Issue 4 | Issue 5 |
    Jan 17 | 12345 |____X___|_________|_________|_________|_________|
    Jan 17 | 23232 |____X___|____X____|_________|_________|_________|
    Jan 17 | 57983 |________|_________|____X____|_________|_________|
    Jan 17 | 45921 |____X___|____X____|_________|_________|____X____|
    Feb 17 | 98569 |________|_________|____X____|____X____|_________|
    Feb 17 | 35741 |____X___|_________|_________|_________|_________|
    Mar 17 | 52896 |____X___|_________|_________|_________|_________|
    Mar 17 | 86248 |________|_________|____X____|____X____|_________|
    Mar 17 | 31598 |____X___|____X____|____X____|____X____|___X_____|


    ...and I want something that looks like this...


    | Jan 17 | Feb 17 | Mar 17 |
    Issue 1 | 3 | 1 | 2 |
    Issue 2 | 2 | 0 | 1 |
    Issue 3 | 1 | 1 | 2 |
    Issue 4 | 0 | 1 | 2 |
    Issue 5 | 1 | 0 | 1 |


    Do I have to convert the top table to 1 line per issue, or is there an easier way to convert the data to the summary format I want? (The "x"'s don't have to be "x"'s, I can change them to "1"'s or whatever helps.)

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Converting a table to a Pivotable?

    You will need a VBA routine to convert the "strung out" data into a normalized format. This is a commonly asked question, so I think I'm going to write some generic code to do it.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    02-15-2017
    Location
    America
    MS-Off Ver
    2010 and 2016
    Posts
    5

    Re: Converting a table to a Pivotable?

    OK, I have a mock-up of what it looks like (actually, I eliminated all the sensitive info, copy and pasted into a new workbook, and inspected the workbook just to be safe).

    But I don't see "Go Advanced" anywhere. I even searched for the text. Where will I find "Go Advanced"?
    Attached Files Attached Files

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Converting a table to a Pivotable?

    I'll lodge my normal complaint and then get on with it. This should really be a database application. But your company is afraid of databases and they never did it that way before, so we'll have to pave the cow path and put the cows on rollerblades. This looks like it is based on an old paper ledger book design. Nothing could be worse for automation. Having said that, yes, we can write code to automate it.

    The first thing that has to be fixed is that you want a monthly report, but you track data by week and on a separate worksheet for each week. So all of this data will have to be collected to one sheet. Then we can begin the task of normalizing it.

    Actually, looking at the data layout, we probably only need to do the consolidating. I don't think normalization will be necessary. Technically speaking, even consolidation would not be necessary, you would just need formulas with 52 terms . I'm not going to do that! I'll get on this and get back to you.

  5. #5
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Converting a table to a Pivotable?

    There are a couple of additions to the workbook.

    First is the Control Panel. This sets up things for you.

    Cell G1 has the first of the year. Cell I1 is the first Monday of the year. This generates the table in columns F:I.

    Select a week number in cell B2 and then click on Make Sheet. This button copies the template worksheet, gives it a name appropriate for the dates selected, and puts it in immediately after the Start sheet.

    The templates have “hidden dates" in cells F4 and G4 (they are white text) – these are used for data validation. On each sheet, you should only be able to enter dates for the selected week

    The template sheet may be hidden if you wish.

    Select the weekly sheet and do the data entry. The code and formulas count whatever is in the cell. It does not have to be an “x.” Blank cells are not counted.

    After filling in the data for the week, click on the consolidate button. This button consolidates the data onto the data sheet. The data sheet is used in the formulas on the YTD sheet. Each column contains monthly totals except for the current month which is month to date.

    The data sheet may also be hidden.

    The Start and End sheets are used to tell the program what sheets to consider for consolidation. Any sheet between these two sheets will be rolled up into the data.

    These sheets may also be hidden if you wish. You can also hide past week data sheets.

    On the YTD summary, I look back to the Control Panel sheet and get the last 12 months with the current month being the latest. This will roll over automatically each month. If you want, I can lock this back down to May 1, 2016 – it’s a matter of tinkering with the formulas on the control panel sheet.

    The YTD cells have formulas in them. If you overwrite these formulas with data, the formulas will be lost, so do the data entry on the weekly sheets. The exception is the no shows. There are no formulas in that row other than the total.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    02-15-2017
    Location
    America
    MS-Off Ver
    2010 and 2016
    Posts
    5
    Quote Originally Posted by dflak View Post
    I'll lodge my normal complaint and then get on with it. This should really be a database application. But your company is afraid of databases and they never did it that way before, so we'll have to pave the cow path and put the cows on rollerblades. This looks like it is based on an old paper ledger book design. Nothing could be worse for automation. Having said that, yes, we can write code to automate it.

    The first thing that has to be fixed is that you want a monthly report, but you track data by week and on a separate worksheet for each week. So all of this data will have to be collected to one sheet. Then we can begin the task of normalizing it.

    Actually, looking at the data layout, we probably only need to do the consolidating. I don't think normalization will be necessary. Technically speaking, even consolidation would not be necessary, you would just need formulas with 52 terms . I'm not going to do that! I'll get on this and get back to you.
    I'm no slouch to Access. And my first thought was, "Hey, this might be better as a database application." My second thought is, "Maybe it could be done with PivotTables."

    I'm out of town this week, when I return I'm going to try to talk them into a database. The person I talked to was new and "that's just how it was set up when I started."

  7. #7
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Converting a table to a Pivotable?

    Inertia is a hard thing to fight. In the long run, a database would be better, however, it turned out not to be as bad as I thought. The weekly sheets are consistent which makes the coding a lot easier.

+ 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. Banded Rows for Pivotable
    By lordfa9 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 09-26-2017, 01:51 AM
  2. [SOLVED] Convert table with multiple header columns into a pivotable table
    By jasonleewkd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2013, 03:20 AM
  3. Pivotable problems
    By QuentinChina in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-25-2013, 03:23 AM
  4. Adjustable Entries in Pivotable
    By johnvhkim in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-16-2012, 06:35 AM
  5. [SOLVED] Using text in pivotable headings
    By Ozwilly in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 08-05-2012, 08:44 PM
  6. Create a List That is Pivotable
    By Cecil in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-16-2012, 03:06 AM
  7. [SOLVED] pivotable drill down
    By gjpj in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2006, 08:35 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