How do I get a chart for a count of values in 3 bar chart in Excel?

跟風遠走 提交于 2019-12-24 18:31:51

问题


I have a survey that is sent out to customer. The survey has 3 questions with 3 options to choose from:

  1. Not Satisfied
  2. Satisfied and
  3. Very Satisfied.

The results data looks something like this:

Question 1      Question 2      Question 3      Date
Not Satisfied   Satisfied       Satisfied       04/07/2017
Satisfied       Satisfied       Satisfied       04/07/2017
Satisfied       Satisfied       Very Satisfied  04/07/2017
Not Satisfied   Satisfied       Satisfied       04/07/2017
Very Satisfied  Satisfied       Satisfied       04/07/2017
Not Satisfied   Very Satisfied  Satisfied       05/07/2017
Satisfied       Satisfied       Very Satisfied  05/07/2017
Very Satisfied  Very Satisfied  Very Satisfied  05/07/2017
Very Satisfied  Satisfied       Satisfied       06/07/2017
Very Satisfied  Very Satisfied  Satisfied       06/07/2017
Not Satisfied   Satisfied       Satisfied       06/07/2017
Very Satisfied  Very Satisfied  Very Satisfied  06/07/2017
Very Satisfied  Very Satisfied  Satisfied       06/07/2017

How do I get a 3 bar chart indicating the 3 questions that will show the counts of the number of 'Not Satisfied', 'Satisfied' and 'Very Satisfied' values?

I would like my chart to look something like this:

 |
 |   Q1  Q2  Q3         Q1  Q2  Q3          Q1  Q2  Q3
 |       ___ ___                            ___ ___ ___
5|   ___|   |___|                          |   |   |___|
4|  |___|   |   |       ___ ___ ___        |   |   |   |
3|  |   |   |   |      |___|___|   |       |   |___|   |
2|  |___|   |   |      |___|   |___|       |___|   |   |
1|  |   |   |   |      |   |   |   |       |   |   |   |
 ---------------------------------------------------------
     04/07/2017         05/07/2017          06/07/2017

I tried making a Pivot Table but I wasn't able to figure it out.


回答1:


You can do this if you add another table with some formulas. It can get a little wonky to set up, but it works.

First, let's create some named ranges.

For the Question 1 results (results only, don't include the headers), call those Question_1_results. Question 2 results, Question_2_results, and finally the Question 3 results name Question_3_results.

For the dates, just call the named range dates.

Now set up this table:

(Note: Row 17 is to help with the formula. You'll just be using B18:K22 for the chart. Row 18 does have merged cells, which I usually shy away from, but you need those here to get the chart's X Axis to look right.)

In C20, enter this formula. Then you can copy it to all those blank cells in the range C20:K22

=COUNTIFS($E$2:$E$14,C$17,INDIRECT(SUBSTITUTE(C$19," ","_")&"_results"),$B20)

And finally, simply highlight your new table, go to Insert --> Stacked Column Chart:




回答2:


Your data is in a format that is not easy to work with, but luckily since it is only a few options, it should be easy to manipulate.

You could create 3 new columns labeled Question 1 to 3.
Under each you could do 3 countif formulas

i.e. assuming Question 1 is in column A =COUNTIF(A:A,"Satisfied"), then =COUNTIF(A:A,"Very Satisfied")

repeat for question 2 and question 3

Once you create a table that way, you can simply select it and insert a stacked bar chart. I hope that makes helps.



来源:https://stackoverflow.com/questions/46185525/how-do-i-get-a-chart-for-a-count-of-values-in-3-bar-chart-in-excel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!