简体   繁体   English

Excel公式-计算每天所有最新时间的平均时间

[英]Excel formula - Calculating the average time for all of the latest time for each day

I have a list of dates/Time. 我有日期/时间清单。 What I want to do is find the average of the latest time for each day. 我想做的是找到每天的最新时间的平均值。 Can someone help me with the formula? 有人可以帮我解决这个问题吗?

Here's an example: 这是一个例子:

6/23/2016 14:42:00 6/23/2016 14:42:00
6/23/2016 4:20:00 6/23/2016 4:20:00
8/30/2016 9:20:00 2016年8月30日9:20:00
8/30/2016 19:20:00 2016年8月30日19:20:00
8/31/2016 13:20:00 2016年8月31日13:20:00
8/31/2016 16:20:00 2016年8月31日16:20:00
9/1/2016 13:20:00 9/1/2016 13:20:00
9/1/2016 19:20:00 9/1/2016 19:20:00

It should then be calculating the average time of "6/23/2016 14:42:00", "8/30/2016 19:20:00", "8/31/2016 16:20:00" and "9/1/2016 19:20:00". 然后应计算平均时间“ 6/23/2016 14:42:00”,“ 8/30/2016 19:20:00”,“ 8/31/2016 16:20:00”和“ 9 / 1/2016 19:20:00”。

Thanks for the help. 谢谢您的帮助。

Hard solution would look like this: 硬解决方案如下所示:

Get distinct dates first. 首先获取不同的日期。 This is done by typing formula =ROUNDDOWN(A1,0) , assuming that your values are in column A. 假设您的值在A列中,则通过键入公式=ROUNDDOWN(A1,0)来完成此操作。

Now copy the column with results into another column using Paste Values . 现在,使用“ 粘贴值 ”将包含结果的列复制到另一列中。

After that you should remove duplicates from the column you pasted your values in and next to it insert Array Formula 之后,您应该从粘贴值的列中删除重复项,并在其旁边插入数组公式

=MAX(IF(criteria_range=criteria,value_range))

All you have to do now is run an average on it. 您现在要做的就是对它进行平均。

Now, if you are to use it more than once, just record a macro using the above steps. 现在,如果要多次使用它,只需按照上述步骤记录一个宏。

*Array formula is applied by using Ctrl + Shift****+Enter (Instead of regular Enter ) *通过使用Ctrl + Shift **** + Enter (而不是常规Enter )应用数组公式

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

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