+ Reply to Thread
Results 1 to 15 of 15

checking for consecutive values

  1. #1
    Registered User
    Join Date
    08-08-2011
    Location
    israel
    MS-Off Ver
    Excel 2007
    Posts
    18

    Unhappy checking for consecutive values

    Hello everyone
    I have a table that consists of date, name, company name, an absence.
    in the absence filed there is numbers 0 and 1(for absence).
    I would like to see who has an absence of more than 3 consecutive meetings.
    Can anyone help me how to do it? Whether by the date whether by absence?
    Excel formula or VBA.
    I'm going crazy, so I would appreciate anyone who could only help

    Thanks in advance
    Raz

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,053

    Re: checking for consecutive values

    Maybe this:

    =SUMPRODUCT(J3:J26, J4:J27, J5:J28) will bring you number of absences...

    Or =SUMPRODUCT(J3:J26, J4:J27, J5:J28)>0 will return TRUE if there was an absence... otherwise FALSE.
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    08-08-2011
    Location
    israel
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: checking for consecutive values

    thenx for the quick reply
    but i actually want to chek if the absence heppend 3 times in a row

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,053

    Re: checking for consecutive values

    And this doesn't work?

    please check example and say what you would like to get for your result:
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-08-2011
    Location
    israel
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: checking for consecutive values

    i will try to expline better.
    i would upload the file but i can't, and its in another langue so you problaly wont understand the file anyway
    ether way
    i have a list of meeting.
    in that list
    i have companies and in each company there is a number of people(i have the same people in sevrel companies).
    an a date of the meeting and if that person was absence or not.
    i need to flag to myself(for reports later on) for each person in a company that have more then 3 consecutive absences in a quarter.
    if the absences is 3 but not consecutive i don't care.

    do i make myself any more reasonable? :/

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,053

    Re: checking for consecutive values

    I see you speak english very well to create one small example workbook No need to upload whole original data... Just what's important for your issue.

  7. #7
    Registered User
    Join Date
    08-08-2011
    Location
    israel
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: checking for consecutive values

    ok your right

    in the file i upload i want to flag
    that for person 1
    he have 3 consecutive absence in a row...
    but if i had another date in between(like the 3/9 ) with 0 instead of 1. then it won't flag me..

    make any sense?
    Attached Files Attached Files

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,053

    Re: checking for consecutive values

    OK... What now person1 have 3 absence (and 0 presence)...

    Bu if person1 would have 2 absence then 1 presence then again 2 absence it won't mark it? right?

  9. #9
    Registered User
    Join Date
    08-08-2011
    Location
    israel
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: checking for consecutive values

    nop.... only 3 in a row....

  10. #10
    Registered User
    Join Date
    08-08-2011
    Location
    israel
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: checking for consecutive values

    i guess it's more difficult then i thought so

  11. #11
    Registered User
    Join Date
    08-08-2011
    Location
    israel
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: checking for consecutive values

    ohhh i'm sorry zbor, i didn't read it correctly... your were right.. it wont mark it

  12. #12
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,053

    Re: checking for consecutive values

    I can't find any simplier solution... try this with extra column.... TRUE is where it repeats (Conditional formating is based on that cell)...

    Also, no need for two column (presence and abesnce) since they are complementar)....

    it was hard for me to work from right to left so I switch.. hope you will be able to see how it work...
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    08-08-2011
    Location
    israel
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: checking for consecutive values

    wow thats great
    but i have few questions..
    why do i get #num! in some fields?
    and what does the formula does ? run the entire range and look for a series of 3 1's in a row? for the same person?
    You're a genius, i can't thank you enough

  14. #14
    Registered User
    Join Date
    08-08-2011
    Location
    israel
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: checking for consecutive values

    and one more thing
    can i get it to run for each quarter speardly?
    for example if i had a lot more names in the list and much more dates
    so that the run will go on each quarter and a year?

  15. #15
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,053

    Re: checking for consecutive values

    You get NUM because it look for 3rd highest value. If there is no 3 dates it will return error...
    Obviously, none person can't miss 3 times if there were 2 meetings so it doesn't consider it.

    I need to check.. I'm affraid that it won't work if all users are not at all meetings.. but I don't have time to check anymore so I hope someone else will look at it... please test and return workbook where it's fault so we can test it closly...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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