+ Reply to Thread
Results 1 to 7 of 7

Count a specific date within a range of multiple dates

  1. #1
    Registered User
    Join Date
    10-22-2015
    Location
    england
    MS-Off Ver
    2013
    Posts
    5

    Count a specific date within a range of multiple dates

    Hi,
    I'm struggling with working the code that will enable me to count the number of times a specific date falls between ranges of multiple dates. I'm trying to automate a system to allow me to see how many people are at work on any given day of the month by knowing when they are on rotation.
    E.g.
    Mr M Smith is at work 22nd Oct 2015 until 20th Nov 2015 so need to show as a number that he is at work on 23rd Oct 2015.
    Miss S White is at work 29th Oct 2015 until 30th Nov 2015 so need to show as a number if she is at work on 28th Oct 2015
    Etc.
    I've attached the spreadsheet I'm working with. I've only been able to show "FALSE" or "YES"/"NO" for the adjacent dates not the whole range in columns C and D. I’d like the result to show a number i.e. 10 or 20 people are at work on 28th Oct 2015 etc.

    Any help would be much appreciated.
    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Count a specific date within a range of multiple dates

    Try
    B2=COUNTIFS($C$2:$C$152,">="&A2,$C$2:$C$152,"<="&A2)+COUNTIFS($D$2:$D$152,">="&A2,$D$2:$D$152,"<="&A2)

    May be this will help.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Registered User
    Join Date
    10-22-2015
    Location
    england
    MS-Off Ver
    2013
    Posts
    5

    Re: Count a specific date within a range of multiple dates

    Thanks Ankur, but it's not working. A random date of 15th Oct 2015 is showing 9 but using conditional formatting it shows there are 28 entries that meet that criteria. I've updated the spreadsheet to show that.
    Regards
    Attached Files Attached Files

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Count a specific date within a range of multiple dates

    Sorry I am unable to understand what you actually want, however Try =COUNTIFS($C$2:$C$152,">="&A2)+COUNTIFS($D$2:$D$152,"<="&A2)

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


    If it not what you looking for, please mention desired result once

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Count a specific date within a range of multiple dates

    b2=COUNTIFS($C$2:$C$152,"<="&A2,$D$2:$D$152,">="&A2)
    Please Login or Register  to view this content.
    Try this and copy towards down
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  6. #6
    Registered User
    Join Date
    10-22-2015
    Location
    england
    MS-Off Ver
    2013
    Posts
    5

    Re: Count a specific date within a range of multiple dates

    Shukla, Siva,
    This works brilliantly; thank you so much for your help.
    Really appreciated.
    Regards
    Marcus

  7. #7
    Registered User
    Join Date
    10-22-2015
    Location
    england
    MS-Off Ver
    2013
    Posts
    5

    Re: Count a specific date within a range of multiple dates

    Folks, the help you gave was invaluable but I'd like to ask one more question if I may. Is it possible to insert the names of the people who are "Working" on a given day in a separate column based on the day you open the file? Or at least highlight the names?
    Attached Files Attached Files

+ 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: 9
    Last Post: 10-08-2015, 01:50 PM
  2. Count number of times a specific date happens between two dates
    By Interrogo in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-16-2015, 10:02 PM
  3. [SOLVED] Count cells within a specific date range that contain a specific word
    By oneillp1 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-23-2014, 08:34 AM
  4. Replies: 1
    Last Post: 02-05-2013, 09:14 AM
  5. Count values in a range that appear for specific dates
    By galvinpaddy in forum Excel General
    Replies: 1
    Last Post: 11-02-2011, 03:45 PM
  6. Count specific dates in cell range for current month
    By rboggio1 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-22-2009, 10:21 PM
  7. Replies: 25
    Last Post: 09-07-2005, 12:05 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