按月计算出现次数

按月计算出现次数

本文介绍了Excel:按月计算出现次数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个电子表格,其中所有的数据都在一张表格上,而另一个则是指标。我需要一个excel公式的帮助,这将允许我按月份总计PO的数量。



单元格中的表格1 A2:A50 我有这种格式的日期(4/5/13) 。在单元格中的表格2 E5 我有四月份,我希望它总计在F5中创建的PO数量。



我该怎么做?



我尝试使用 = COUNTIF('2013'!$ A $ 2:$ A $ 50,'2013 Metrics'!E5)。我有一种感觉,因为我的范围是4/5/13格式,我的标准是4月,这将不起作用。



我可以使用这个公式,按月计算总支出: = SUM(IF(MONTH('2013'!$ A $ 2:$ A $ 19)= 4,'2013'!$ D $ 2:$ D $ 19,0))但不幸的是,每月有多少个PO。

解决方案

使用数据透视表。您可以通过右键单击并单击刷新来手动刷新数据透视表的数据源。否则,您可以设置一个工作表_更改宏 - 或只是一个刷新按钮。数据透视表教程在这里:



1)从Date列创建Month列(例如 = TEXT(B2,MMM)





2)从日期列创建年份列(例如 = TEXT(B2, YYYY)





3)添加一个Count列,每个值为1





4)创建一个包含字段的数据透视表,计数,月和年
5)将Year和Month字段拖入行标签。确保年份高于月份,因此您的数据透视表按年份,然后按月份
首先分组6)将计数字段拖动到值以创建计数计数





有更好的教程我是肯定只是google / bing数据透视表教程。


I am creating a spreadsheet with all my data on one sheet and metrics on the other. I need help with an excel formula that will allow me to total the number of PO's by month.

On sheet 1 in cells A2:A50 I have the dates in this format (4/5/13). On sheet 2 in cell E5 I have April and I want it to total the number of PO's created in F5.

How can I do this?

I have tried using =COUNTIF('2013'!$A$2:$A$50,'2013 Metrics'!E5). I have a feeling that since my range is in 4/5/13 format and my criteria is April that won't work.

I was able to use this formula for total spend by month: =SUM(IF(MONTH('2013'!$A$2:$A$19)=4,'2013'!$D$2:$D$19,0)) but not luck with how many PO's by month.

解决方案

Use a pivot table. You can manually refresh a pivot table's data source by right-clicking on it and clicking refresh. Otherwise you can set up a worksheet_change macro - or just a refresh button. Pivot Table tutorial is here: http://chandoo.org/wp/2009/08/19/excel-pivot-tables-tutorial/

1) Create a Month column from your Date column (e.g. =TEXT(B2,"MMM") )

2) Create a Year column from your Date column (e.g. =TEXT(B2,"YYYY") )

3) Add a Count column, with "1" for each value

4) Create a Pivot table with the fields, Count, Month and Year5) Drag the Year and Month fields into Row Labels. Ensure that Year is above month so your Pivot table first groups by year, then by month6) Drag the Count field into Values to create a Count of Count

There are better tutorials I'm sure just google/bing "pivot table tutorial".

这篇关于Excel:按月计算出现次数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-03 23:13