+ Reply to Thread
Results 1 to 12 of 12

Electrical Time of Use Calculations

  1. #1
    Registered User
    Join Date
    04-08-2013
    Location
    Sidney, NE
    MS-Off Ver
    Excel 2010
    Posts
    11

    Question Electrical Time of Use Calculations

    I use Excel quite a bit but am not the greatest at formulas. I'm inserting an image of what my data looks like and I'll describe what I want to accomplish.

    First, I need Excel to look at the day of the week and time of day to determine if its an on/off peak day and an on/off peak time of day. 11 p.m. to 7 a.m., Monday through Saturday is always off peak, and then Sunday all day is off peak. Also, we have 5 or 6 holidays (I'd have to look at rate schedule to see what they are) that are off peak. What do I need to do to calculate this on ever cell, so at the beginning of each month, I'm not manually moving my formulas around to the correct days of the week?

    Sorry if I'm not making my questions clear. Hopefully someone is familiar with what I'm trying to do. I tried to search the forums for something like this, but not sure what to look for. Please point me in the right direction if its already answered.

    Thanks in advance!! Below is the image!

    Column D and E sum up the KWH (column B) down to that point and then I add all those up at the bottom. D and E have those formulas at the end of each on/off peak. They add up the previous time period's KWH. If it would be better for me to attach the working document, I can create a non-sensitive copy.

    TOU Data Calculation.jpg

  2. #2
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Re: Electrical Time of Use Calculations

    There is probably a simpler way to do this but here's my way in the meantime (see attached).

    I've inserted three columns to help. The first one extracts the day from your timestamp (Mon Tue Wed etc). The second extracts the time.
    The third checks if the day is a sunday first, and returns OFF is so. if not it then checks if the time is during peak hours. If so it returns ON, if not it returns OFF.

    Your two columns for off peak and on peak then have formulas in place which will work depending on the ON/OFF result. You just need modify them to include your formula.

    Hope that makes sense.
    Attached Files Attached Files
    Say thanks, click *

  3. #3
    Registered User
    Join Date
    04-08-2013
    Location
    Sidney, NE
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Electrical Time of Use Calculations



    That is exactly what I was trying to do. I had the right idea, I was just putting the "AND" portion of my formula in the wrong place. Also, I was using a round about way to get the day of week and time out of the timestamp, and so you taught me how to extract the text and format. Was not sure how to use that either!

    Thanks you SO very much!!!!

  4. #4
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: Electrical Time of Use Calculations

    Here is a solution without having the day and time extracted (based solely on cell A2):
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Please click the * icon below if I have helped.

  5. #5
    Registered User
    Join Date
    04-08-2013
    Location
    Sidney, NE
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Electrical Time of Use Calculations

    Quote Originally Posted by Melvinrobb View Post
    Here is a solution without having the day and time extracted (based solely on cell A2):
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    I like that option just because it would save me a couple of columns, but I have to include the 23:00 increment in my On Peak because the data at 23:00 is actually used in the 15 minute period before that! And I think I would be eliminating the 7:00 through 7:45 increments with that formula also. Correct me if I'm missing something here.

    Thanks!

    One more question in all this... Does Excel recognize or acknowledge holidays? And can I specify which ones I want to include in the Off Peak data?

  6. #6
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: Electrical Time of Use Calculations

    Would this work?
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    This formula now displays "OFF" if:
    Weekday = 1 (sunday)
    OR
    It is prior to 7:00
    OR
    It is later than or equal to 23:00

  7. #7
    Registered User
    Join Date
    04-08-2013
    Location
    Sidney, NE
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Electrical Time of Use Calculations

    That might! Will that return all 23:00 to 23:45 increments tho? Or does it look beyond the hour even tho it doesn't return the :15, :30, etc.?

    Thanks!

  8. #8
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: Electrical Time of Use Calculations

    The best way to answer that is to open the file HARRIBONE attached, put in my formula, and simply test the examples you are mentioning, and find out if what my formula returns is what you want.
    If the time is 23:00 or 23:45, it will return "OFF". if the time is 7:00 or 7:45, the time is "ON".

  9. #9
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Re: Electrical Time of Use Calculations

    For days you want to specify as a holiday/off peak you will need to create a new sheet (Called Holidays for this example). In column A enter the dates that you have eg. 03/01/2013.
    Make sure you set the column format to TEXT so this way will work.

    =IF(IFERROR(VLOOKUP(TEXT(A2,"dd/mm/yyyy"),Holidays!A:A,1,0),0)=TEXT(A2,"dd/mm/yyyy"),"OFF",IF(OR(WEEKDAY(A2)=1,HOUR(A2)<7,HOUR(A2)>=23),"OFF","ON"))

    This is Melvinrobb's formula with a bit extra to check if the date is in your list.

  10. #10
    Registered User
    Join Date
    04-08-2013
    Location
    Sidney, NE
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Electrical Time of Use Calculations

    You guys rock!!! That pretty much takes all the human error away now! Very much appreciated!!!!!

  11. #11
    Registered User
    Join Date
    04-08-2013
    Location
    Sidney, NE
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Electrical Time of Use Calculations

    Quote Originally Posted by Harribone View Post
    For days you want to specify as a holiday/off peak you will need to create a new sheet (Called Holidays for this example). In column A enter the dates that you have eg. 03/01/2013.
    Make sure you set the column format to TEXT so this way will work.

    =IF(IFERROR(VLOOKUP(TEXT(A2,"dd/mm/yyyy"),Holidays!A:A,1,0),0)=TEXT(A2,"dd/mm/yyyy"),"OFF",IF(OR(WEEKDAY(A2)=1,HOUR(A2)<7,HOUR(A2)>=23),"OFF","ON"))

    This is Melvinrobb's formula with a bit extra to check if the date is in your list.
    Another question about the IFERROR part of that equation. I can't seem to wrap my mind around what that does. I'm assuming it's saying that if the VLOOKUP on the Holidays tab causes an error, it just returns a 0, but even if that's correct, why do we need that? I tried removing the IFERROR part of the formula and it just creates a !NAME# error (or w/e it is).

    Thanks.

  12. #12
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Re: Electrical Time of Use Calculations

    Without it the formula will try to evaluate #N/A=TEXT(A2,"dd/mm/yyyy") when the date is not found. This will therfore result in an erro as the overall answer. Putting the iferror around this bit means the #N/A wil be 0 instead so the formula evalutes 0=TEXT(A2,"dd/mm/yyyy") instead. As this is always FALSE it knows that the date isn't in your holiday list and moves on to the rest of the normal checks.

    For reference you don't have to use 0 in the iferror, you can use anything you want whether it be a digit, text or another formula.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1