+ Reply to Thread
Results 1 to 6 of 6

On-peak, and Off-peak calculations - Please help with the formulae

  1. #1
    Registered User
    Join Date
    02-10-2013
    Location
    chicago, il
    MS-Off Ver
    Excel 2007
    Posts
    10

    On-peak, and Off-peak calculations - Please help with the formulae

    I need help in sorting out a logic to calculate the on-peak, off-peak and mid-peak hours.
    Please see the attached file for the inputs.
    Thank you very much for your help and God bless you.
    GA
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: On-peak, and Off-peak calculations - Please help with the formulae

    First of all, you need to correct the entry in L23 as it doesn't make sense - I changed it to 18:00:00.

    Put this formula in G28:

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


    and copy across to L28 (i.e. excluding the Sunday column).

    Then put this formula in G29:

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


    and copy across to L29.

    Put this formula in G30:

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


    and copy across to L30. Then put this formula in M30:

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


    Hope this helps.

    Pete

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: On-peak, and Off-peak calculations - Please help with the formulae

    G28 and across: =MAX(0, MIN(G16, G23) - MAX(G15, G22))

    G29 and across: =MAX(0, MIN(G17, G23) - MAX(G16, G22))

    G30 and across: =G23-G22 - (G29+G28)
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    02-10-2013
    Location
    chicago, il
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: On-peak, and Off-peak calculations - Please help with the formulae

    Thanks a ton for your reply. How can this be modified to handle None (for example, there are no on-peak and mid-peak hours on Sundays).

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: On-peak, and Off-peak calculations - Please help with the formulae

    Don't know who you are replying to, but my first three formulae specifically exclude Sundays and the fourth one is for Sunday only. Perhaps you can apply shg's formulae in the same way.

    Hope this helps.

    Pete

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: On-peak, and Off-peak calculations - Please help with the formulae

    How can this be modified to handle None
    Change all the hours for Sunday to the same value, e.g. 0:00.

+ 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