简体   繁体   English

Excel:根据日期和时间计算平均每日天然气使用量

[英]Excel: Calculate average daily usages of gas based on date and time

awkward question to word. 尴尬的问题。 I'm using Excel and would like to calculate the average usage of gas in my house. 我正在使用Excel,并且想计算我家中的平均汽油使用量。 I have got a list of times and dates which I write down when I get chance or remember, is there a good way to do this? 我有时间和日期的清单,当我有机会或记得时可以写下来,有没有很好的方法?

I would like to use cell formulas by the way. 我想顺便使用单元格公式。

An example of the data I have to work with: 我必须使用的数据示例:

  Date/Time         Gas   Electric
25/01/15 01:48    £10.62    £3.38
                           +£5.00
26/01/15 01:48    £8.56     £6.92
26/01/15 02:00    £8.18     £6.45
27/01/15 13.19    £7.44     £6.03
27/01/15 18.00    £7.06     £5.57
27/01/15 19:50    £7.06     £5.41
27/01/15 21:14    £6.97     £5.26

Edit: Using TriHard8's answer, this is what is produced 编辑:使用TriHard8的答案,这是产生的 在此处输入图片说明

Does this mean that 0.70 pence is used each hour based on the two times? 这是否意味着每小时两次使用0.70便士?

Edit 2: Still getting negative numbers :S 编辑2:仍得到负数:S 在此处输入图片说明

Gas used between 2 dates/times divided by ((Date2 + Time2) - (Date1 + Time1)). 2个日期/时间之间使用的气体除以((Date2 + Time2)-(Date1 + Time1))。 (10.62 - 8.56) / ( (26/01/15 + 01:48) - (25/01/15 + 01:48) ) (10.62-8.56)/((26/01/15 + 01:48)-(25/01/15 + 01:48))

Put this formula into H6: =( F5 - F6 ) / ( (D6+E6) - (D5+E5) ) This will be use per day. 将此公式放到H6中:=(F5-F6)/((D6 + E6)-(D5 + E5))这将每天使用。 It doesn't matter if you compare 2 measurements from the same day, or over 20 days, it will be the average per day. 如果您比较同一天或超过20天的2个测量值,则没有关系,这将是每天的平均值。

You need to make sure that you format the resulting cell to be a number, with whatever precision you'd like. 您需要确保以所需的精度将结果单元格的格式设置为数字。

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

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