+ Reply to Thread
Results 1 to 9 of 9

Calculate total in range that are before specific time:

Hybrid View

BastImret Calculate total in range that... 07-16-2020, 07:59 PM
BastImret Re: Calculate total in range... 07-16-2020, 08:05 PM
BastImret Re: Calculate total in range... 07-16-2020, 09:27 PM
bebo021999 Re: Calculate total in range... 07-16-2020, 10:02 PM
BastImret Re: Calculate total in range... 07-16-2020, 11:56 PM
bebo021999 Re: Calculate total in range... 07-17-2020, 12:03 AM
BastImret Re: Calculate total in range... 07-17-2020, 02:21 AM
bebo021999 Re: Calculate total in range... 07-17-2020, 03:16 AM
BastImret Re: Calculate total in range... 07-19-2020, 04:39 PM
  1. #1
    Registered User
    Join Date
    02-10-2020
    Location
    Oregon, USA
    MS-Off Ver
    2016
    Posts
    68

    Calculate total in range that are before specific time:

    I hope I can explain this clearly.
    I have a range of A11:A18 that contain times (1700, 1800, 1900, 2000 through 2400 currently.)
    B11:B18 is where the number of slots open that I'm tracking are recorded.
    Range I3:K8 contain:
    I= Slot labels
    J= Slot open times
    K= Slot close times

    With B11 is where how many slots remain open at 1700 is input, I'd like a formula to auto fill that number based on the times in the range I3:K8.

    Attached is a sample which I hope better explains what I'm trying to accomplish. I'm not certain the best approach for this other than no VBA.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    02-10-2020
    Location
    Oregon, USA
    MS-Off Ver
    2016
    Posts
    68

    Re: Calculate total in range that are before specific time:

    I'm thinking a formula that counts how many K3:K8 have times that are below 2400, how many below 2300, below 2200, and so on?

  3. #3
    Registered User
    Join Date
    02-10-2020
    Location
    Oregon, USA
    MS-Off Ver
    2016
    Posts
    68

    Re: Calculate total in range that are before specific time:

    I'm not sure how to even tell excel that 0100 is after 2400...

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,645

    Re: Calculate total in range that are before specific time:

    Because your number-store-as text, try to convert them to real number, by this:
    Copy any blank cell
    Highlight the range A11:A18
    Paste special/value and Operation: Add
    Format to be general
    Similar to J and K
    Then in B11:
    =COUNTIFS($J$3:$J$8,"<="&A11,$K$3:$K$8,">="&A11)
    OR, if dont change format, in B11:
    =SUMPRODUCT(($J$3:$J$8+0<=A11+0)*($K$3:$K$8+0>=A11+0))
    Attached Files Attached Files
    Quang PT

  5. #5
    Registered User
    Join Date
    02-10-2020
    Location
    Oregon, USA
    MS-Off Ver
    2016
    Posts
    68

    Re: Calculate total in range that are before specific time:

    bebo021999, the times in A11 through, can run from 1700 to 0200. I'd need a way (maybe a helper column) that determines 0100 later than 2400 for example.
    1700
    1800
    1900
    2000
    2100
    2200
    2300
    2400
    0100
    0200

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,645

    Re: Calculate total in range that are before specific time:

    I can see the data validation source in R:S display 17:00-24:00?
    Can you type the real time range and some of cases those representative 0100 or 0200 and mock up results?

  7. #7
    Registered User
    Join Date
    02-10-2020
    Location
    Oregon, USA
    MS-Off Ver
    2016
    Posts
    68

    Re: Calculate total in range that are before specific time:

    Attached is report from yesterday. Stripped of sensitive data and whatnot.
    I left the areas that I'm working on as is for a real world example...
    The actual times that are tracked hourly are from 1700 through 0200 for our business day. The 24hour time format and general layout are decided by the powers that be, above my pay grade.
    Attached Files Attached Files

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,645

    Re: Calculate total in range that are before specific time:

    Inteprete time that less than 0200 to plus 1 day = 2400

    Try:

    =SUMPRODUCT(($J$11:$J$16 <=(A29+(A29+0 <=200)*2400))*
    (($K$11:$K$16+($K$11:$K$16+0 <=200)*2400) >=(A29+(A29+0 <=200)*2400)))

  9. #9
    Registered User
    Join Date
    02-10-2020
    Location
    Oregon, USA
    MS-Off Ver
    2016
    Posts
    68

    Re: Calculate total in range that are before specific time:

    bebo, thank you for the help. Your solution worked perfect

+ 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] Use VLOOKUP and SUMPRODUCT to calculate total between time range for specific criteria
    By klavierkatze in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-15-2020, 01:34 PM
  2. [SOLVED] Calculate total hours that fall between a specific date / time period (Over midnight)
    By nik_re in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-21-2020, 09:05 AM
  3. [SOLVED] Calculate total hours that fall between a specific time period (Over midnight)
    By nik_re in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-20-2020, 09:06 AM
  4. [SOLVED] Formula Needed - Calculate total hours that fall between a specific time period.
    By JennyGP in forum Excel - New Users/Basics
    Replies: 8
    Last Post: 04-19-2020, 02:44 AM
  5. [SOLVED] How to calculate total time-intervals that correspond to a specific criterion
    By esketit in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-03-2018, 05:58 AM
  6. Replies: 1
    Last Post: 05-30-2017, 04:45 PM
  7. Replies: 10
    Last Post: 08-12-2014, 07:48 AM

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