Google电子表格COUNTIF TODAY()?
有没有办法COUNTIF
它是当前的date?
例如,我有一个工作单的电子表格,一旦员工开始工作订单,它捕获一个时间戳,工作单完成后,它被移动到一个档案,以及我想创build一个汇总表,告诉我有多less个订单我们已经做了那个date,时间戳的格式是:
2/19/2014 17:10:20
所以基本上我需要一个COUNTIF
来计算当前date的列。
这可能吗?
您需要首先在范围上应用函数,然后使COUNTIF
不是一个合适的函数来计算匹配“today”的date。 您可以使用SUMPRODUCT
代替:
=arrayformula(SUMPRODUCT(1*(INT(A1:A100)=TODAY())))
INT
从date时间中删除时间。
新版本的Google表格有COUNTIFS,它允许=COUNTIFS(A:A,">="&TODAY(),A:A,"<"&TODAY()+1)
不过,您需要select新版本才能使其工作。 (“尝试新的Google表格”)
如果你没有COUNTIFS
可用,按照maybeWeCouldStealAVan's
build议,那么你可以使用两个COUNTIF
函数
=COUNTIF(A:A,">="&TODAY())-COUNTIF(A:A,">="&TODAY()+1)
通过计算大于或等于今天的所有条目,然后减去所有大于或等于明天的条目,结果是仅在今天的date
该公式将工作在Excel或谷歌 – 另一个选项,类似于杰里的是使用这个googledocs具体公式
=count(filter(A1:A100,int(A1:A100)=today()))
尝试这个:
dim i as integer dim objDate as date dim objStartDate as Date dim objEndDate as Date dim countOrders as integer countOrders = 1 objStartDate = 'the start date to check with ( could be the start of the day) objEndDate = 'the end date to check with (could be the end of the day) for i = 1 to 'number of rows objDate = CDate(cells(i, 1)) if (objDate > objStartDate) and (objDate < objEndDate) then countOrders = countOrder +1 end if next i