Count number of occurrences by month

2020-03-21 10:35发布

I am creating a spreadsheet with all my data on one sheet and metrics on the other.

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.

标签: excel formula
7条回答
相关推荐>>
2楼-- · 2020-03-21 11:03

use count instead of sum in your original formula u will get your result

Original One

=SUM(IF(MONTH('2013'!$A$2:$A$19)=4,'2013'!$D$2:$D$19,0))

Modified One

=COUNT(IF(MONTH('2013'!$A$2:$A$19)=4,'2013'!$D$2:$D$19,0))

AND USE ctrl+shift+enter TO EXECUTE

查看更多
登录 后发表回答