+ Reply to Thread
Results 1 to 24 of 24

max value within a time range

  1. #1
    Registered User
    Join Date
    01-07-2023
    Location
    USA
    MS-Off Ver
    365
    Posts
    82

    max value within a time range

    Hello

    I would like to find the max value "High" (Column C) within every range of Time 19:00 to 17:00 in a large data set

    Then with the next range of 19:00 to 17:00

    Then mark the High of the 7:00 Time and mark if that value is higher then the previous 19 to 17 Segment High

    Thank You
    Attached Files Attached Files
    Last edited by Writingformulas; 05-15-2024 at 01:42 PM. Reason: amended file

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,907

    Re: max value within a time range

    Does your version support the MAXIFS() function? If so, I would do something like:

    1) Add a helper column to combine date and time into a single value. In D2, enter =SUM(A2:B2) and copy/paste/fill down.
    2) In my summary table, enter the 7 PM on each date. I chose J2 and entered 5/12/2019 19:00, in J3, entered 5/13/2019 19:00, then dragged to fill down as far as needed.
    3) The max for each 7 PM to 5 PM period is then a simple MAXIFS() function. =MAXIFS($C$2:$C$1000,$D$2:$D$1000,">="&J2,$D$2:$D$1000,"<"&J3) entered into K2 and copied down.
    4) Assuming I understand the next step, the value at 7 PM is a simple lookup function. =INDEX($C$2:$C$1000,MATCH(J2,$D$2:$D$1000,1)). In L2 and copied down.
    5) Then you can compare the maximum from the previous time period with the value at 7 PM of the next time period with a simple boolean expression (entered into an IF() function, if desired). In M3, I can enter =IF(L3>K2,"larger","not") copy/paste/fill down.

    Would a strategy like that work for you?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    01-07-2023
    Location
    USA
    MS-Off Ver
    365
    Posts
    82

    Re: max value within a time range

    HI Mr shorty

    Yes it does support maxifs

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,907

    Re: max value within a time range

    Since the moderators have directed you back here, is there something in my solution that you are having trouble implementing? Or something I misunderstood? Or do you simply prefer a VBA based solution since you tried posting in the VBA section?

  5. #5
    Registered User
    Join Date
    01-07-2023
    Location
    USA
    MS-Off Ver
    365
    Posts
    82

    Re: max value within a time range

    yes I m thinking vba solution

    or maybe not I will try your suggestion

    Thank You
    Last edited by Writingformulas; 05-13-2024 at 10:57 PM.

  6. #6
    Registered User
    Join Date
    01-07-2023
    Location
    USA
    MS-Off Ver
    365
    Posts
    82

    Re: max value within a time range

    shory

    Boolan I do not know this

  7. #7
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,907

    Re: max value within a time range

    Boolean is an expression that results in a "true/false" result. In the example I gave =IF(L3>K2,"larger","not"), the L3>K2 is the boolean expression that will return TRUE if L3 is larger than K2, and FALSE if it is not. Then the IF() function makes a choice based on the boolean result.

  8. #8
    Registered User
    Join Date
    01-07-2023
    Location
    USA
    MS-Off Ver
    365
    Posts
    82

    Re: max value within a time range

    Mr Shorty

    Im unable to get the previous suggestion working , suggestions please.

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

    Re: max value within a time range

    Please amend your file to show EXPECTED answers... exactly as you want them... where you want them.
    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

  10. #10
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,907

    Re: max value within a time range

    Which step is giving you trouble?

    When I follow the steps I outlined, I get this.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    01-07-2023
    Location
    USA
    MS-Off Ver
    365
    Posts
    82

    Re: max value within a time range

    Shorty

    I must of entered incorrectly

    I will try again

    Thank You

  12. #12
    Registered User
    Join Date
    01-07-2023
    Location
    USA
    MS-Off Ver
    365
    Posts
    82

    Re: max value within a time range

    Thank You

    im formatting the date how could I get the year too

  13. #13
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,907

    Re: max value within a time range

    When I started learning spreadsheets, this was one of the help files I most frequently referenced: https://support.microsoft.com/en-us/...rs=en-us&ad=us

  14. #14
    Registered User
    Join Date
    01-07-2023
    Location
    USA
    MS-Off Ver
    365
    Posts
    82

    Re: max value within a time range

    Shorty I got your suggestion to work but the issue is 5/12/2019 1900 to 5/13/2019 1700 is one day
    Last edited by Writingformulas; 05-15-2024 at 01:09 PM. Reason: typo

  15. #15
    Registered User
    Join Date
    01-07-2023
    Location
    USA
    MS-Off Ver
    365
    Posts
    82

    Re: max value within a time range

    hello I sent an amended file

  16. #16
    Registered User
    Join Date
    01-07-2023
    Location
    USA
    MS-Off Ver
    365
    Posts
    82

    Re: max value within a time range

    Shorty I sent an amended file I m wanting to copy these formulas down
    Last edited by Writingformulas; 05-15-2024 at 01:49 PM. Reason: amended file

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

    Re: max value within a time range

    Thanks for the sample file. That makes things clearer.

    Delete ALL expected results.

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

  18. #18
    Registered User
    Join Date
    01-07-2023
    Location
    USA
    MS-Off Ver
    365
    Posts
    82

    Re: max value within a time range

    Glenn Thank You

    Do I put the code into L

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

    Re: max value within a time range

    Put it wherever you want on that sheet! Just ensure there's room for the results to spill across and down. The only adjustment needed is to sub-formula A (the range)..

    You're welcome.




    Please take a moment and consider clicking the "Add Reputation" button at the foot of any of the posts of anyone who helped you reach a solution here today.

    Finally, if that takes care of your original question, please click on "Thread Tools" from the menu link (just above the first post in the thread) and mark this thread as SOLVED.

  20. #20
    Registered User
    Join Date
    01-07-2023
    Location
    USA
    MS-Off Ver
    365
    Posts
    82

    Re: max value within a time range

    and then to sort :

    say if I have for example

    5/1
    5/2 this is greater then 5/1
    5/3 this is greater then 5/2

    thank You

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

    Re: max value within a time range

    I have no idea what you are talking about. Add your expected answers to my LAST attachment.

  22. #22
    Registered User
    Join Date
    01-07-2023
    Location
    USA
    MS-Off Ver
    365
    Posts
    82

    Re: max value within a time range

    please see a larger data set showing a friday included

    is it possible to designate if

    High data is on the 5/12 1900

    but the day 5/12 1900 to 5/13 1700

    call this the 5/13 day
    Attached Files Attached Files

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

    Re: max value within a time range

    I still have absolutely no idea what you are talking about.

    WHAT do you expect to see?

    WHERE doe you expect to see it?

    SHOW me in a file... don't given me another explanation that (to me) makes no sense!!

  24. #24
    Registered User
    Join Date
    01-07-2023
    Location
    USA
    MS-Off Ver
    365
    Posts
    82

    Re: max value within a time range

    please see file in post 22

    thank You

+ 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. [SOLVED] Formula to check if a time range falls within another time range
    By Doopinator in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-01-2023, 08:16 PM
  2. Replies: 2
    Last Post: 06-26-2018, 09:10 PM
  3. Formula to substract a range of time from a range of time
    By nabeel.rehman in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 05-22-2017, 01:14 PM
  4. [SOLVED] COUNTIF Time Range - Time Range provided in Cells
    By Eaks77 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-02-2015, 11:12 PM
  5. [SOLVED] Counting values in a time range - when the time range crosses midnight
    By dlocos in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-24-2014, 04:27 AM
  6. Calculate if Time range appears in an other Time range
    By bajdr47 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-25-2013, 02:50 AM
  7. compare time values - current time with time in cell range?
    By wyattea in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-13-2013, 11:28 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