+ Reply to Thread
Results 1 to 6 of 6

Count Consecutive Days Based on Unique Number

  1. #1
    Forum Contributor
    Join Date
    02-20-2011
    Location
    Candada
    MS-Off Ver
    Microsoft Office 365
    Posts
    174

    Arrow Count Consecutive Days Based on Unique Number

    Hello everyone,
    I am trying to find a formula which count consecutive days for each unique personal ID number in column A and get the result in column N. For example, Walter Jones has 19 consecutive worked days, Marco Polo has 21 consecutive worked days and so on. Also, data in column A to I will continue to be added as days pass by. Data in column L to M might change depending employees get hired or terminated.
    See example for better detail
    Thank you everyone for your help and time
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Count Consecutive Days Based on Unique Number

    Hi Kimston,

    See the attached with a helper column formula. I've also needed to sort by Date (old to new) and then my name to make the Helper column work. See if you can live with a few extra steps in the process to get an answer.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say 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
    52,929

    Re: Count Consecutive Days Based on Unique Number

    Not sure how you get 19 for Smith, I get 20...
    =COUNTIF($E$2:$E$78,M2)

    What am I missing here?

    edit: OK I see what I was missing, needed to scroll left
    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
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Count Consecutive Days Based on Unique Number

    Hi,

    Here is another method that uses a few more helper columns but sorting isn't needed.

  5. #5
    Forum Contributor
    Join Date
    02-20-2011
    Location
    Candada
    MS-Off Ver
    Microsoft Office 365
    Posts
    174

    Re: Count Consecutive Days Based on Unique Number

    Thank you very much Mr. MarvinP and Mr. FDibbins for your help. The only questions that I have are why do we have to use 4 helpers? Also, is it possible to use the PersonID numbers rather than the person names? The reason for this is because there are several employees with the same first and last name.
    Again,
    Thank you for your time and excellent work!

  6. #6
    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
    52,929

    Re: Count Consecutive Days Based on Unique Number

    I have done it with 1 helper.

    I2=IFERROR(IF(INDEX(B3:$B$78,MATCH(E2,E3:$E$78,0))-1=B2,1,0),FALSE)
    copied down

    I added some extra columns while playing with this, so Im not sure what your original columns where, but but this next to where your unique names are...
    =SUMIF($E$2:$E$78,S3,$I$2:$I$78)

+ 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: 2
    Last Post: 07-25-2013, 01:01 PM
  2. [SOLVED] Count unique number of days
    By Jwildcat in forum Excel General
    Replies: 2
    Last Post: 06-29-2012, 05:34 PM
  3. Replies: 2
    Last Post: 11-05-2011, 07:29 AM
  4. count consecutive negative days
    By pault22 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2010, 08: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