计算一组条件在时间序列中的出现次数 [英] Counting number of occurrences in a time series for a set of condition(s)
问题描述
作为示例,我需要对所附表进行一些摘要统计. 一些要回答的问题包括:
I am required to do some summary statistics on the attached table as an example. Some of the questions to answer include:
1)有多少个具有有效时间序列的国家(在给定指标名称的2010-2015年期间,至少具有一个值/数字的国家/地区) 例如:计算有多少国家针对该指标的有效时间序列:已完成申请的数量"
1) How many countries with valid time series (countries that have at least one value/number for a given indicator name over the time period of 2010-2015) e.g: Count how many countries have valid times series for the indicator: "Number of completed applications"
2)对于给定的国家和指标,具有有效时间序列的年数是多少. 例如:关于已完成申请的指标数量和国家(地区)加拿大? (答案:2-> 2014年,2015年)
2) For a given country and indicator what is the number of year(s) with valid time series. e.g: For the indicator number of completed applications and the country Canada? (Answer: 2 --> 2014, 2015)
或者,如果表看起来像这样(这是典型的csv格式),可以采用什么方法来回答上面的两个汇总统计信息问题?
Alternatively, if the table look like this instead (which is a typical csv format) what approach could be taken to answer the two summary statistics questions above?
我已经尝试过对数据透视表使用sumproduct公式的方法.有没有比这种方法更好的方法?
I have tried method of sumproduct formula for the pivoted table. Is there a better way than this method?
= SUMPRODUCT(N((B2:B14> 0)+(C2:C14> 0)+(D2:D14> 0)+(E2:E14> 0)+(F2:F14> 0)+(G2 :G14> 0)+(H2:H14> 0)+(I2:I14> 0)+(J2:J14> 0)> 0))
=SUMPRODUCT(N((B2:B14>0)+(C2:C14>0)+(D2:D14>0)+(E2:E14>0)+(F2:F14>0)+(G2:G14>0)+(H2:H14>0)+(I2:I14>0)+(J2:J14>0)>0))
但是什么时候是平面桌呢?
But what about when it is a flat table?
推荐答案
因此,有一个countifs()和sumifs()的示例:
So, an example of countifs() and also sumifs():
来自Nevsky-非常感谢您提供的示例!我可以自由地对其进行如下修改:
这篇关于计算一组条件在时间序列中的出现次数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!