+ Reply to Thread
Results 1 to 12 of 12

CountIf falls between times

  1. #1
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    CountIf falls between times

    Hi,

    I'm looking for some help coming up with a formula for the attached worksheet.

    In the table of cells A3:G12 there is a list of staff I have working that day and the hours that they are working, which I enter manually.

    The table A14:G89 is a list of matches that my staff will be monitoring which I paste in from a downloaded list. Column G is blank when I paste is filled in by the table on the right which is what I want to achieve at then end.

    Once I have entered the times that people are working that day then scroll over to the right and look to fill in the column headed 'Monitoring'.

    What I want help with is the 'Schedule Table' at the top of the worksheet. What I want to do here is place a formual in these cells to display how many matches a member of staff is monitoring concurrently at any given 15 minute interval. I've filled in down to the 11.05 kick-off to show what I want it to display but obviously I want to find a formula to replace this manual intervention.

    Many thanks,
    Adam.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Re: CountIf falls between times

    Can anyone help? I'm sure this must be doable, let me know I've not made it very clear.

    Thanks.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,047

    Re: CountIf falls between times

    You have 35 for Matt, how do you arrive at that?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: CountIf falls between times

    Hi Adam, try copy this formula across L4:CE12
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    ps: you can use conditional formula to hide those zeros if you prefer not to display them on the schedule


    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  5. #5
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Re: CountIf falls between times

    ahhh... sorry, ignore that column, I can soon fix that bit.

    I'm interested at the minute in putting formulas in the table at the top of the page (L4:DC12) to count how many matches each member of staff is monitoring at a time.

  6. #6
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Re: CountIf falls between times

    Alvin-Chung's formula works great.... almost!

    The problem I've noticed with it now is that if I delete some fixtures from columns A:F then I get #Value errors. I can't have this as the number of rows in columns A:F will be different on a daily basis.

    Can anyone offer some advice on how to alter the formula?

  7. #7
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: CountIf falls between times

    Hi Adam, it's hard to imagine the error that you mentioned.
    Could you upload a spreadsheet with the error so that I can have a look?

  8. #8
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Re: CountIf falls between times

    Hi Alvin,


    I don't have access to the computer at the moment but if you use the original example at the beginning of the thread. Then paste your formula in to L4 (and drag down and right to fill the box) then delete some fixtures from the bottom of columns A:F, you will see what I mean.

    Thanks,
    Adam

  9. #9
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: CountIf falls between times

    Hi Adam,

    That's due to invalid value in column J and K, try this modified array formula:

    Please Login or Register  to view this content.
    ps: use ctrl+shift+enter to produce array formula


    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  10. #10
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Re: CountIf falls between times

    Alvin - You are a star! That's perfect, thanks very much!

    While you're such a genius can you explain one last issue? If you look at 'Phil' on my table (L12:DC12), he is greyed out all day (as if he is off duty). This is because his finish time appears to be before his start time but this is just because he starts at 4pm and finishes at 1am the following day. In fact, even if I have him starting at 01:00 to 10:00 then only the hours from 06:00 are un-greyed. You have any idea how I can get around this?

  11. #11
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Re: CountIf falls between times

    Worked out this bit...

    Quote Originally Posted by adam2308 View Post
    In fact, even if I have him starting at 01:00 to 10:00 then only the hours from 06:00 are un-greyed.
    Just stuck on the part where a shift starts one day and finishes the next now.

  12. #12
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: CountIf falls between times

    Quote Originally Posted by adam2308 View Post
    Alvin - You are a star! That's perfect, thanks very much!

    While you're such a genius can you explain one last issue? If you look at 'Phil' on my table (L12:DC12), he is greyed out all day (as if he is off duty). This is because his finish time appears to be before his start time but this is just because he starts at 4pm and finishes at 1am the following day. In fact, even if I have him starting at 01:00 to 10:00 then only the hours from 06:00 are un-greyed. You have any idea how I can get around this?
    Hi Adam, you're welcome

    Try replace last two of your Conditional Formatting (fill with grey) with one Conditional Formatting as follow:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    ps: you've to change your time format in CF1:DC1 to h:mm:ss AM/PM


    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

+ 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. Replies: 4
    Last Post: 09-25-2013, 04:00 PM
  2. Determining if a datetime falls within start and end date times
    By migooz in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-25-2013, 03:05 PM
  3. Replies: 3
    Last Post: 07-27-2013, 02:49 PM
  4. Replies: 4
    Last Post: 07-11-2012, 12:36 PM
  5. if a timetag falls between 2 times then...
    By metalelectrode in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-14-2010, 10:06 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