简体   繁体   English

如何在Excel中绘制随年龄及其计数的图表

[英]How to draw chart in excel with age and its count

I have create a chart with age and its count in excel. 我创建了一个图表,其中包含年龄及其在excel中的计数。 How can I count the number of people in age 1,2,3,4..14. 我如何计算1,2,3,4..14岁的人数。

Age
4
3
10
8
2
5
5
4
6
2
1
8
4
9
5
8
12
8
4
10
1
7
8

Please help! 请帮忙!

What do you mean by in age 1...14? 您在1 ... 14岁的年龄是什么意思? To what I understand, you can use countif function. 据我了解,您可以使用countif函数。 A possible answer for your question can be seen here 您的问题的可能答案可以在这里看到


Clear instruction and syntax can be seen here 清晰的指令和语法可以在这里看到
I will summarise: 我将总结一下:
So you this is the function countif ( range , criteria ). 因此,这就是函数countif( rangecriteria )。
range indicates the ranges of excel fields you will count range表示您将计算的excel字段的范围
criteria indicates the rules of the fields. criteria指示字段的规则。
For example =countif (A1:A3,"apple"). 例如= countif(A1:A3,“苹果”)。 The function will count from field A1 to field A3. 该功能将从字段A1到字段A3计数。 If the field has value of "apple" it will be counted. 如果该字段的值为“ apple”,它将被计算在内。

You can do it in 2 or more different ways: 1. By adding pivot table with age on row and count of age in values.(most easy) 2. Assuming you data is on column am you can set 14 cells with values 1 to 4 on lets say column c (from c1 to c14) and on d1 enter: 您可以通过2种或更多种不同的方式进行操作:1.通过添加数据透视表并在行上添加年龄,并在值中添加年龄(最简单)。2.假设您的数据在列上,则可以设置14个单元格,其值1至4在说c列(从c1到c14),在d1上输入:

=countif(a:a,c1)

and drag this to the until row 14. 并将其拖到第14行。

@user41048, as said by Balinti, you can certainly use COUNTIF or a PIVOT table. 正如Balinti所说,@ user41048当然可以使用COUNTIF或PIVOT表。 Say for example you need to find number of people in the age group of 20, All you have to do is, Select the cell you want to enter the formula and type this, =COUNTIF(Data Range, Criteria) 举例来说,您需要查找20岁年龄段的人数,您所要做的就是,选择要输入公式的单元格并键入此值,即= COUNTIF(Data Range,Criteria)

Where Data range is the range of cells, criteria is the age you want to count for? 数据范围是单元格的范围,标准是您要计算的年龄?

However for a better understanding on how you can use COUNTIF, Please Refer to the below link. 但是,为了更好地了解如何使用COUNTIF,请参考以下链接。

http://chandoo.org/wp/2008/11/12/using-countif-sumif-excel-help/ http://chandoo.org/wp/2008/11/12/using-countif-sumif-excel-help/

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

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