Forum Discussion

garygiles01's avatar
garygiles01
Copper Contributor
Dec 06, 2022
Solved

How to use IF statements to calculate power usage and cost

Hello,

 

I am trying to use IF statements (I think this is correct) to work out power usage of a machine at certain times to therefore workout the cost associated with running this.

 

Please see the photos with the information. I am unsure of the formula to write to work out the amount of time the machine is running between certain times (peak power times, off-peak times, etc).

 

The overall goal is to input the start and end kw/hr reading as well as the start and finish time of the machine. Excel will then do the rest calculating the time in each period (peak, off-peak, etc) and therefore a total cost for that day.

 

Thanks to HansVogelaar for responding to a previous post (forgot my login details and therefore have a new Microsoft Account) which had an answer, but I could not translate that work into what I am trying to achieve above. Sorry I didn't get a chance to say thank you!

 

 

Hopefully someone can help me out.

 

Thanks in advance.

4 Replies

  • garygiles01 

    Could you attach a small sample workbook demonstrating the problem (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar?

    • garygiles01's avatar
      garygiles01
      Copper Contributor

      Thanks HansVogelaar, very much appreciated.

      Here is the link to the sheet. Sheet 1 was your first iteration.

      Thank you again in advance.

      https://1drv.ms/x/s!Am09L0ilmxefb7GNEPbPXOtkSDc?e=0TW6pC

      • HansVogelaar's avatar
        HansVogelaar
        MVP

        garygiles01 

        See the attached version. The formulas are simpler since you want to calculate the periods for every individual day.

        The cost now takes the change in rate into account.

Resources