计算一个日期发生的次数,并从中作图

时间:2022-12-30 23:54:09

I have a list of dates, each date in it can occur more than once. I want to count the number of times each date occurs (histogram) and display it in a graph (with the Y axis being the number of times the date occurs and the X axis being the date itself)?

我有一个日期列表,其中的每个日期都可能出现不止一次。我想要计算每个日期发生的次数(直方图)并将其显示在一个图形中(Y轴表示日期发生的次数,X轴表示日期本身)?

Sample list:

样品清单:

19/05/2012
19/05/2012
19/05/2012
17/05/2012
17/05/2012
16/05/2012
16/05/2012
16/05/2012
16/05/2012
15/05/2012
15/05/2012
15/05/2012
15/05/2012
12/05/2012
12/05/2012
12/05/2012
7/05/2012

2 个解决方案

#1


61  

The simplest is to do a PivotChart. Select your array of dates (with a header) and create a new Pivot Chart (Insert / PivotChart / Ok) Then on the field list window, drag and drop the date column in the Axis list first and then in the value list first.

最简单的方法是做一个数据透视表。选择您的日期数组(带有头部)并创建一个新的数据透视图表(插入/数据透视图表/确定),然后在字段列表窗口中,首先拖放轴列表中的日期列,然后在值列表中首先拖放日期列。

Step 1:

步骤1:

计算一个日期发生的次数,并从中作图

Step 2:

步骤2:

计算一个日期发生的次数,并从中作图

#2


5  

If you have Excel 2010 you can copy your data into another column, than select it and choose Data -> Remove Duplicates. You can then write =COUNTIF($A$1:$A$100,B1) next to it and copy the formula down. This assumes you have your values in range A1:A100 and the de-duplicated values are in column B.

如果您有Excel 2010,您可以将数据复制到另一个列中,而不是选择它并选择data ->删除重复项。然后可以在它旁边写上=COUNTIF($A$1:$A$100,B1)并把公式抄下来。这假设您的值在A1:A100范围内,而反重复值在B列中。

#1


61  

The simplest is to do a PivotChart. Select your array of dates (with a header) and create a new Pivot Chart (Insert / PivotChart / Ok) Then on the field list window, drag and drop the date column in the Axis list first and then in the value list first.

最简单的方法是做一个数据透视表。选择您的日期数组(带有头部)并创建一个新的数据透视图表(插入/数据透视图表/确定),然后在字段列表窗口中,首先拖放轴列表中的日期列,然后在值列表中首先拖放日期列。

Step 1:

步骤1:

计算一个日期发生的次数,并从中作图

Step 2:

步骤2:

计算一个日期发生的次数,并从中作图

#2


5  

If you have Excel 2010 you can copy your data into another column, than select it and choose Data -> Remove Duplicates. You can then write =COUNTIF($A$1:$A$100,B1) next to it and copy the formula down. This assumes you have your values in range A1:A100 and the de-duplicated values are in column B.

如果您有Excel 2010,您可以将数据复制到另一个列中,而不是选择它并选择data ->删除重复项。然后可以在它旁边写上=COUNTIF($A$1:$A$100,B1)并把公式抄下来。这假设您的值在A1:A100范围内,而反重复值在B列中。