计算当前月份的行数 &Google 表格或 Excel 中的年份 [英] Calculate number of rows with current month & year in Google Sheets or Excel
本文介绍了计算当前月份的行数 &Google 表格或 Excel 中的年份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一行用 MM/dd/yyyy 格式的日期填充(带标题行),例如:
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
我想计算与当前月份匹配的行数&年.在上面的例子中,结果显然是两个(2015 年 5 月).
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).
使用函数可以实现这个结果吗?最好使用 Google 电子表格,但 Excel 也可以.
Is this possible to achieve this result using a function? Preferably using Google Spreadsheet, but Excel is also fine.
推荐答案
在 Google 表格中你可以使用
In Google sheets you can use
=COUNT(FILTER(A:A,MONTH(A:A) = MONTH(TODAY()),YEAR(A:A)=YEAR(TODAY())))
其中 A:A 是包含您的日期的列
Where A:A is the column with your dates
这篇关于计算当前月份的行数 &Google 表格或 Excel 中的年份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文