计算当前月份的行数Google表格或Excel中的一年 [英] Calculate number of rows with current month & year in Google Sheets or Excel

查看:114
本文介绍了计算当前月份的行数Google表格或Excel中的一年的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一行以格式MM / dd / yyyy(带标题行)填充日期,例如:

  DATES 
5/12/2015
4/12/2012
5/7/2015
5/7/2014
/ pre>

我想计算与当前月份相匹配的行数年。在上面的例子中,结果显然是两个(当它是2015年5月)。



这是否可以使用一个函数来实现这个结果?最好使用Google电子表格,但Excel也很好。

解决方案

在Google工作表中,您可以使用

  = COUNT(FILTER(A:A,MONTH(A:A)= MONTH(TODAY()),YEAR(A:A)= YEAR(TODAY )))

其中 A:A 是您的日期列


I have one row filled with dates in the format MM/dd/yyyy (with header row), such as:

DATES
5/12/2015
4/12/2012
5/7/2015
5/7/2014

I would like to count the number of rows which match the current month & year. In the example above, the result would obviously be two (when it's May 2015).

Is this possible to achieve this result using a function? Preferably using Google Spreadsheet, but Excel is also fine.

解决方案

In Google sheets you can use

=COUNT(FILTER(A:A,MONTH(A:A) = MONTH(TODAY()),YEAR(A:A)=YEAR(TODAY())))

Where A:A is the column with your dates

这篇关于计算当前月份的行数Google表格或Excel中的一年的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆