简体   繁体   English

以月日格式计算年龄的平均年龄

[英]Calculate age average from age in month day format

I have ages in month.day format like this: 我在month.day格式中有这样的年龄:

35,24
36,11
36,19
37,18
35,12
37,04
35,20
36,01
35,26
36,05
36,16
37,28

for example for the first entry, the age is 35 months and 24 days. 例如,对于第一次输入,年龄是35个月零24天。 How can I average them all to get a proper age average in the same format? 我如何才能对它们全部求平均以得到相同格式的适当年龄平均数?

Thanks 谢谢

Here is a rough approximation: 这是一个大概的近似值:

在此处输入图片说明

My formula in B14: 我在B14中的公式:

=ROUNDDOWN((SUM(B2:B13)*30.5+SUM(C2:C13))/(ROW(B14)-2)/30.5, 0)
  • Sum of the months times 30.5 (rough avg days in month) 月份的总和乘以30.5(每月的平均天数)
  • Add the sum of the days 加总天数
  • Divide by the entries (made this flexible for flexible amount of entries) 除以条目(使之灵活,以实现灵活的条目数量)
  • Divide out by days to get months average and rounddown 除以天数可获得月平均值和四舍五入

My formula in C14: 我在C14中的公式:

=ROUNDDOWN((SUM(B2:B13)*30.5+SUM(C2:C13))/(ROW(B14)-2)-(B14*30.5), 0)
  • Sum of months and days again to get total days 几个月和几天的总和再次获得总天数
  • Divide by entries to get average days 按条目除以获取平均天数
  • Subtract out days already accounted for in months (B14) 减去已经占月份数的天数(B14)
  • Rounddown 舍入

If it can be reasonably assumed that a month is equal to 30 days then the following will return an average in the form of mm,dd . 如果可以合理地假设一个月等于30天,则以下结果将以mm,dd的形式返回平均值。

=INT((SUMPRODUCT(LEFT(A2:A13, FIND(",", A2:A13)-1)*30+MID(A2:A13, FIND(",", A2:A13)+1, 99))/ROWS(A2:A13))/30)&
  ","&
  INT(MOD((SUMPRODUCT(LEFT(A2:A13, FIND(",", A2:A13)-1)*30+MID(A2:A13, FIND(",", A2:A13)+1, 99))/ROWS(A2:A13)),30))

average_dumb_dates

Upon doing the question on STDDEV I found I just need to change to average to get the answer for this: 在对STDDEV进行问题后,我发现我只需要更改为平均值即可得到答案:

=QUOTIENT(AVERAGE(LEFT(A1:A12,2)*30 + RIGHT(A1:A12,2)),30)&","&ROUND(MOD(AVERAGE(LEFT(A1:A12,2)*30 + RIGHT(A1:A12,2)),30),2)

It is an array formula so it needs to be confirmed with Ctrl-Shift-Enter. 这是一个数组公式,因此需要使用Ctrl-Shift-Enter进行确认。 You can change the rounding on the days to what every you want by changing the last number in the formula. 您可以通过更改公式中的最后一个数字,将天数舍入为所需的每一天。

在此处输入图片说明

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

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