简体   繁体   English

如何在Excel中的3条形图中获取价值计数的图表?

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

I have a survey that is sent out to customer. 我有一份调查问卷已发送给客户。 The survey has 3 questions with 3 options to choose from: 该调查有3个问题,有3个选项可供选择:

  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? 我如何获得一个3条形图,指示3个问题,这些问题将显示“不满意”,“满意”和“非常满意”值的数量计数?

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. 我尝试制作数据透视表,但无法弄清楚。

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 . 对于问题1的结果(仅结果,不包括标题),请调用那些Question_1_results Question 2 results, Question_2_results , and finally the Question 3 results name Question_3_results . 问题2的结果Question_2_results ,最后是问题3的结果名称Question_3_results

For the dates, just call the named range dates . 对于日期,只需调用命名范围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.) (注意:第17行是为了帮助您使用公式。您只需在图表上使用B18:K22 。第18行确实有合并的单元格,我通常避开这些单元格,但是您需要这里的单元格才能获取图表的X Axis看起来正确。)

In C20 , enter this formula. C20 ,输入此公式。 Then you can copy it to all those blank cells in the range C20:K22 然后,您可以将其复制到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: 最后,只需突出显示您的新表,请转到插入->堆积柱形图:

在此处输入图片说明

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. 您可以创建3个新列,标记为问题1至3。
Under each you could do 3 countif formulas 在每个下可以做3个countif公式

ie assuming Question 1 is in column A =COUNTIF(A:A,"Satisfied"), then =COUNTIF(A:A,"Very Satisfied") 例如,假设问题1在A列中= COUNTIF(A:A,“满意”),然后= COUNTIF(A:A,“非常满意”)

repeat for question 2 and question 3 对问题2和问题3重复

Once you create a table that way, you can simply select it and insert a stacked bar chart. 以这种方式创建表格后,您只需选择它并插入堆积的条形图即可。 I hope that makes helps. 我希望能有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM