2

I have a list of times. Every time an action is done it adds the time it happened to a log file. I would like to get the average for actions/hour. But I don't want to average in the times that there is a gap between actions greater then 10 minutes.

So for example:

   +--------------------+
    11:09 AM    |      
   +--------------------+
    11:02 AM    |      
   +--------------------+
    10:57 AM    |      
   +--------------------+
    10:50 AM    |4 actions 29 minutes - *12:04-10:50 = 1 hour 14 minutes >= 10 minutes 
   +--------------------+
    12:04 PM    |      
   +--------------------+
    12:01 PM    |      
   +--------------------+
    12:01 PM    |      
   +--------------------+
    11:56 AM    |      
   +--------------------+
    11:56 AM    |      
   +--------------------+
    11:55 AM    |      
   +--------------------+
    11:55 AM    |      
   +--------------------+
    11:55 AM    |8 actions 9 minutes *1:19-11:55 = 1 hour 24 minutes >= 10 minutes
   +--------------------+
    1:19 PM     |      
   +--------------------+
    1:18 PM     |      
   +--------------------+
    1:18 PM     |      
   +--------------------+
    1:17 PM     |      
   +--------------------+
    1:17 PM     |      
   +--------------------+
    1:16 PM     |      
   +--------------------+
    1:16 PM     |      
   +--------------------+
    1:16 PM     |8 actions 3 minutes *1:16-1:06 = 10 minutes >= 10 minutes
   +--------------------+
    1:06 PM     |      
   +--------------------+
    1:06 PM     |      
   +--------------------+
    1:06 PM     |      
   +--------------------+
    1:06 PM     |      
   +--------------------+
    1:06 PM     |      
   +--------------------+
    1:06 PM     |6 actions 1 minute *End of Data Sample
   +--------------------+

26 actions complete in 42 minutes (37.1 actions/hour)

NOT

26 actions completed in 1 hour 57 minutes (13.3 actions/hour)

I would prefer a Formula Based Answer but if not possible then VBA will be fine too.

Edit Extra Sample

I want an average of how many actions are recorded for any random hour length of time but I don't want to include any time spans the are between actions done more then 10 minutes apart.

So if from 1:15-5:45 we do 1125 "actions" and from 6:30-7:30 we do 300 "actions" thats 1425 "actions" done in 5.5 hours

That ends up being about 260 "actions/hour" (1125+300 = 1425) done from (1:15-5:45) OR 4.5 hours plus (6:30-7:30) OR 1 hour for a total of 5.5 hours NOT (1:15-7:30) OR 6.25 hours

But if we include the time from 5:45-6:30 that nothing was done it makes the average 228 "actons/hour" much lower then the real average of used time. Hope this helps clear up any confusion

4

1 回答 1

-1

好的,所以我清楚地从一个完全错误的角度看待这个问题,出于某种原因,我认为我必须得到每次除以 10 分钟差异的次平均值,然后得到平均值。

然后我醒了一点,意识到我需要做的就是获得浪费的时间,然后将其从样本的总时间中删除!

不知道我是如何看待这么简单的想法的,但是嘿,该怎么办。

所以,如果我错了,请纠正我,因为我没有时间,也没有时间,所以我还没有完全解决这个想法。

但这是一个非常粗略的例子,说明我认为我需要做些什么才能得到答案,如果我遗漏了什么,请告诉我,或者在我自己解决之前随时清理并将这些东西组合成更简单的形式答案,唯一的先决条件是确保所有时间都按最新到最旧到最新排序,Witch 我的数据会自动设置为查看,因为它是未修改的日志,时间来自输入的时间。

在此处输入图像描述

于 2013-07-06T16:47:15.290 回答