+ Reply to Thread
Results 1 to 7 of 7

Max function with time constraints

  1. #1
    Registered User
    Join Date
    09-20-2016
    Location
    Bangalore
    MS-Off Ver
    2013
    Posts
    32

    Max function with time constraints

    As per the attached file, i have data of 2 days. i need to subtract the max and min of column D on hourly basis. so i need to add two time constraint (Date and Time) to get the ouput. I am not able to complete the process by using function. kindly assist me to get this done.
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Max function with time constraints

    try this array formula:

    =MAX(IF($A$2:$A$794=G2,IF($C$2:$C$794=H2,$D$2:$D$794)))-MIN(IF($A$2:$A$794=G2,IF($C$2:$C$794=H2,$D$2:$D$794)))

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    09-20-2016
    Location
    Bangalore
    MS-Off Ver
    2013
    Posts
    32

    Re: Max function with time constraints

    Hi Glenn,

    Thank you it is working. But however this doesn't reduce the manual work of finding the unique date and hours. Kindly let me know if any to minimize such work

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Max function with time constraints

    So the time period of collection is irregular each day? the process is not being monitored 24/7??

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Max function with time constraints

    No reply yet. The easiest way is to assume that the process is 24/7 and use this to set the date (G2, copied down):
    =$A$2+INT((ROWS($G$2:G2)-1)/24)

    this to set the time(H2, copied down):
    =MOD((ROWS($H$2:H2)-1),24)

    and this array formula to return your value:
    =IF(MAX(IF($A$2:$A$794=G2,IF($C$2:$C$794=H2,$D$2:$D$794)))=0,"",MAX(IF($A$2:$A$794=G2,IF($C$2:$C$794=H2,$D$2:$D$794)))-MIN(IF($A$2:$A$794=G2,IF($C$2:$C$794=H2,$D$2:$D$794))))

    If this is not what you want , then please specify EXACTLY what you want, rather than leave us guessing.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,292

    Re: Max function with time constraints

    And if you take advantage of this formula?
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    09-20-2016
    Location
    Bangalore
    MS-Off Ver
    2013
    Posts
    32

    Re: Max function with time constraints

    Hi Glen,

    I was on leave for few days. Thanks for your input i have completed the process

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Time Constraints
    By atrades in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-06-2013, 02:19 PM
  2. [SOLVED] Extracted time from date/time field does not flag on =IF(TIME function.
    By Vlad717 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-09-2013, 03:29 PM
  3. time constraints for SLA
    By penfold1992 in forum Excel General
    Replies: 14
    Last Post: 10-29-2012, 06:35 AM
  4. Standard Deviation Function with Time Constraints
    By ckatzman in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-10-2012, 06:36 PM
  5. constraints for the trend function
    By name in forum Excel General
    Replies: 0
    Last Post: 07-02-2006, 10:00 PM

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