+ Reply to Thread
Results 1 to 6 of 6

clustered stacked column pivot chart broken down by the data in each attribute

  1. #1
    Registered User
    Join Date
    07-20-2018
    Location
    Boston
    MS-Off Ver
    360
    Posts
    3

    clustered stacked column pivot chart broken down by the data in each attribute

    Hi all, I am trying to build a stacked bar pivot chart with survey data.
    The data was generated from a matrix table question in a survey where responders were evaluating 6 different attributes in 3 different levels.
    The results will look like this:

    user id Q1_Atribute1 Q1_Atribute2 Q1_Atribute3 Q1_Atribute4 Q1_Atribute5 Q1_Atribute6
    1 definitely maybe maybe maybe no way definitely
    2 maybe definitely definitely no way definitely
    3 maybe maybe maybe no way definitely
    4 definitely no way definitely maybe no way
    5 maybe maybe definitely definitely
    6 no way no way no way maybe definitely
    7 maybe no way definitely no way definitely
    8 no way maybe maybe definitely
    9 no way definitely no way no way no way definitely
    10 maybe maybe maybe no way no way definitely

    In excel i am trying to build a stacked bar column chart that will shoe the breakdown of each one of these attributes in the appropriate levels.
    I am able to chart the total responses for each attribute but then cannot break down each column by the ("definitely", "maybe", "no way") shown in different colors. I need them all i one chart so i can do filtering.
    I have attached a sample of the data.
    Thanks to anyone who can help....
    Attached Files Attached Files

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

    Re: clustered stacked column pivot chart broken down by the data in each attribute

    I had to do a bit of a two-step with this. The data had to be converted into numerical data and unfortunately is not organized for a pivot table to do it.

    First, I converted the data into a table and named it Table_Responses. Tables have a lot of advantages, one of them being that the "know" how big they are so any pivot tables, formulas, charts, etc. that reference them always look at the exact right amount of data. There is no need to guess at how many rows to include.

    I made a second table using COUNTIF formulas. When I built the chart on this table, I got a "transposed" stacked bar chart. The X-axis had definite, maybe and no way, and the bars showed the number of questions that had that answer. If you right click on the chart and select the select data option at the top of the dialog box there is an option to transpose the X and Y's.

    In this case, I enumerated the Responses and the Attributes manually. If the responses and attribute data are fixed, this is a viable option. If they can vary, then VB code is required to "build" the table. However, as pointed out above, the chart will react (add values and series) to follow the table whatever content the table winds up with.
    Attached Files Attached Files
    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
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: clustered stacked column pivot chart broken down by the data in each attribute

    My first observation is that your source data is not arranged in the best way for a pivot table. Getting a better pivot table should allow you to get the stacked column chart you want. You might review this recent discussion and associated links: https://www.excelforum.com/excel-new...ta-layout.html

    Here's what I did:
    1) I don't have power pivot or Get and Transform like others do, which should make the "unpivot" step here much easier. I manually unpivoted the data by moving the data for each attribute type down beneath the others to make a long list:
    Please Login or Register  to view this content.
    If Q1 stands for quarter -- suggesting that there is another variable (date/time/quarter) -- then separate that out into another column.
    2) Build pivot table from the new source table with:
    2a) attribute type as row label
    2b) response as column label
    2c) count of response as value field.
    3) Insert stacked column chart based on pivot table.

    Is that what you are trying to do?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Registered User
    Join Date
    07-20-2018
    Location
    Boston
    MS-Off Ver
    360
    Posts
    3

    Re: clustered stacked column pivot chart broken down by the data in each attribute

    Thanks so much dflak, but this is the solution to build a stacked bar column chart. I need to build a stacked bar column Pivot chart, as i will need to filter these data by responder attributes.
    For these purposes i don't think that a simple chart and table will work.
    I have expanded my data with an additional column with table attributes (gender) and when i filter for either one of these the table does not change.
    Any chance you can take a shot at making the change to the pivot chart i had built instead?

  5. #5
    Registered User
    Join Date
    07-20-2018
    Location
    Boston
    MS-Off Ver
    360
    Posts
    3

    Re: clustered stacked column pivot chart broken down by the data in each attribute

    forgot to attach the file again
    Attached Files Attached Files

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

    Re: clustered stacked column pivot chart broken down by the data in each attribute

    This is a much more flexible response anyway.

    As MrShorty pointed out, your data isn't in a format suitable for pivot table analysis. This program puts the data into that format.
    Attached Files Attached Files

+ 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. pivot chart with clustered stacked-columns
    By bsapaka in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 10-07-2020, 06:56 PM
  2. Stacked clustered column chart
    By jpmoglia in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-14-2017, 09:58 PM
  3. 2-level 3-dimensional Pivot chart with stacked-clustered columns
    By Wustuv in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 11-18-2016, 04:45 AM
  4. [SOLVED] Clustered and Stacked column in the same chart
    By bryan444 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 07-16-2013, 10:03 AM
  5. Clustered and Stacked Column Chart
    By superkid in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 02-19-2009, 09:54 AM
  6. [SOLVED] Combined: Clustered-Stacked Column Chart
    By cdo in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-30-2005, 09:05 PM
  7. Clustered column chart with stacked coumns
    By Dave in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-04-2005, 07:06 PM

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