+ Reply to Thread
Results 1 to 12 of 12

Count Consecutive Dates

  1. #1
    Forum Contributor
    Join Date
    08-29-2014
    Location
    Chicago, IL
    MS-Off Ver
    2014
    Posts
    164

    Count Consecutive Dates

    A1= Name
    B1= Date

    I am tracking attendance and one of the rules in the policy is consecutive days absent counts as 1 occurrence.

    Column A Column B
    Dave Jan. 2, 2016
    Dave Jan. 3, 2016
    Dave April 1, 2016
    Dave April 5, 2016

    I would like the count of occurrences, from this example it would be 3 since Jan. 2 and Jan. 3 are counted as 1.

  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,127

    Re: Count Consecutive Dates

    I suspect that this is more complicated than you are currently stating.

    What is the effect of weekends and public holidays? Will Fred's absences be in the same column, all mixed up with Dave's?

    Please attach a sample workbook. Make sure there is enough data to demonstrate your need. Make sure your desired results are shown, mock them up manually if necessary. Remember to remove ALL confidential information first!!!

    However, nothing on this Forum works quite as well as you might expect. The attachment icon doesn't work!! (Helpful, isn't it!!). Instead, just before you submit your post, click on GO ADVANCED (near the bottom) and then scroll down to Manage Attachments to open the upload window. The relevant instructions are at the top of that screen.
    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

  3. #3
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,600

    Re: Count Consecutive Dates

    This solutions employs a helper column (C) which may be hidden for aesthetic purposes. The formula to populate the helper column is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    The formula that will count the number of absence occurrences is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Let me know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  4. #4
    Forum Contributor
    Join Date
    08-29-2014
    Location
    Chicago, IL
    MS-Off Ver
    2014
    Posts
    164

    Re: Count Consecutive Dates

    @Glenn,

    I was able to attach my file and you are correct, this is slightly more complicated.

    I added more data and my intended results in columns D and E.

    if there's a way to include holidays and weekends that would be ideal. For example, an occurrence on Friday and another occurrence on Monday still equals 1 (assuming this employee has Saturday and Sunday off days)

    For company holidays, I could probably enter those on my list for every employee if it's not possible creating a formula for it.
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,600

    Re: Count Consecutive Dates

    I modified the formula that counts the number of absences to take into consideration of the employees name:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    I assume from your comment that some employees work weekends, as in Dave and Steve, which would complicate the blanket inclusion of the workday function.
    Let me know if you have any questions.

  6. #6
    Forum Contributor
    Join Date
    08-29-2014
    Location
    Chicago, IL
    MS-Off Ver
    2014
    Posts
    164

    Re: Count Consecutive Dates

    @jetemc, when I enter the formula I get large negative numbers. Can you check the formula again?

  7. #7
    Forum Contributor
    Join Date
    08-29-2014
    Location
    Chicago, IL
    MS-Off Ver
    2014
    Posts
    164

    Re: Count Consecutive Dates

    was able to make the formula work, but this formula does not combine consecutive days.

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,600

    Re: Count Consecutive Dates

    Here is the file with the formulas applied.
    Let me know if you have any questions.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    08-29-2014
    Location
    Chicago, IL
    MS-Off Ver
    2014
    Posts
    164

    Re: Count Consecutive Dates

    I think the issue with this formula is I have to have names and dates sorted correctly all the time. For example, I will most likely have multiple employees calling off sick on the same day, and the formula in column D doesn't take that into account.

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,600

    Re: Count Consecutive Dates

    One possible 'fix' might be to create an Excel table that could be sorted either by date to enter new data about absences, or by name to display the correct number of absence occurrences per employee.
    Let me know if you have any questions.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    05-06-2016
    Location
    Cluj, Romania
    MS-Off Ver
    2007-2010
    Posts
    220

    Re: Count Consecutive Dates

    Hi,
    I propose an adaptation of the JeteMc`s solution, that takes into account holidays and weekends
    for helper column (C) use this
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    where H2: H3 is the list of holidays

    For List of unique names
    use this array formula (in E2 and drag down)
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and for "Count of occurrences" column
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    see attached
    Attached Files Attached Files

  12. #12
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Count Consecutive Dates

    Another way.

    Helper formula in column C.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    In column E
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I put in some more dates (contiguous across weekends). It seems to work at my end.
    Attached Files Attached Files
    Dave

+ 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: 17
    Last Post: 02-14-2024, 07:07 AM
  2. Count consecutive dates as one
    By squirrellydw in forum Excel General
    Replies: 7
    Last Post: 04-06-2017, 05:48 PM
  3. Count consecutive dates by person
    By KylerStern in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-14-2015, 04:05 PM
  4. Count of consecutive dates as single occasion per patient
    By mallen91693 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-04-2014, 01:32 AM
  5. Replies: 3
    Last Post: 02-16-2012, 01:51 PM
  6. Replies: 3
    Last Post: 02-14-2012, 01:38 AM
  7. Replies: 0
    Last Post: 05-04-2006, 11:10 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