简体   繁体   English

Excel用什么方法计算时间和年龄

[英]Excel what method use to calculate time and age

I have got a table with 2 columns: AGE between 10 and 90 lets say :] and Time (spent on mobiles) What I need to do is- count how long people spent time on mobiles between 16 and 40. First part may be seemingly simple because we can count by countif how may people is using mobiles between 16 and 40 but how evaluate spend time on mobiles by the particular age groups. 我有一个两列的表格:年龄在10到90之间,可以说:]和时间(在手机上花费的时间)我需要做的是-计算人们在手机上花费了多长时间(介于16到40之间)。第一部分似乎是很简单,因为我们可以通过计数来计算人们在16到40岁之间如何使用手机,但是如何评估特定年龄段在手机上花费的时间。 I will appreciate aaany help regards 我会很感激aaany的帮助

If you need to analyze your data more than creating a static function to count, you may consider using Pivot tables. 如果您需要分析数据而不是创建一个静态函数进行计数,则可以考虑使用数据透视表。

Build a simple pivot table with age in rows and time in values. 构建一个简单的数据透视表,其中年龄在行中,时间在值中。 Once this simple pivot table built, you can filter on the rows values, group them together among specific grouping criteria, select specific values by hand, etc. 建立此简单的数据透视表后,您可以过滤行值,根据特定的分组条件将它们分组在一起,手动选择特定的值,等等。

I like the idea given by Boud of using Pivots but if you specifically want a formula then you can use SumProduct() 我喜欢Boud提出的使用数据透视的想法,但是如果您特别想要一个公式,则可以使用SumProduct()

=SUMPRODUCT((A2:A13>16)*(A2:A13<40)*(B2:B13))

Do remember to format the cell as [h]:mm:ss since you are adding up times. 请记住将单元格格式设置为[h]:mm:ss因为您要累加时间。

SNAPSHOT 快照

在此处输入图片说明

You can for example add additional column, with formula like: 例如,您可以使用以下公式添加其他列:

=IF ( AND(A1>16, A1<40), B1, 0 )

where A is column with AGE, and B is column with Time, and then simply sum it! 其中A是具有AGE的列,而B是具有Time的列,然后将其求和即可!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM