+ Reply to Thread
Results 1 to 5 of 5

Consecutive Employee Vacation Days using sumif array with frequency and column functions

  1. #1
    Registered User
    Join Date
    11-16-2012
    Location
    Edinburgh
    MS-Off Ver
    Excel 2003
    Posts
    19

    Consecutive Employee Vacation Days using sumif array with frequency and column functions

    Hi,

    I have a list of dates showing if an employee is on vacation or study leave etc. In my attached example I would like to insert a formula into cell b4 that tells me if the employee has had 10 or more consecutive days off. This should exclude weekends, so need formula to ignore all "WE" cells in row 5.

    I have tried to apply the following array formula "=SUM(IF(FREQUENCY(IF(D6:U6="Holiday",COLUMN(D6:U6)),IF(D6:U6<>"Holiday",COLUMN(D6:U6)))>=10,1))"

    This does not work for 2 reasons:

    a) Its not clever enough to ignore the weekend days
    b) Its not clever enough to recognise that for example "STUDY Leave" also counts as a day off in addition to "HOLIDAY".

    Can anyone help me complete this formula correctly so that cell B4 displays 1 in the given example
    Of course if there is a better way to do this, then Im all ears

    Thank you so much for your help

    Ciaran Mc Mahon
    Attached Files Attached Files

  2. #2
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,676

    Re: Consecutive Employee Vacation Days using sumif array with frequency and column functio

    Hello Ciaran,

    If "Holiday" and "Study Leave" are the only two "day off" options then try this version

    =SUM(IF(FREQUENCY(IF(ISNUMBER(MATCH(D6:U6,{"Holiday";"Study Leave"},0)),COLUMN(D6:U6)),IF(ISNA(MATCH(D6:U6,{"Holiday";"Study Leave"},0))*(D$5:U$5="WD"),COLUMN(D6:U6)))>=10,1))

    confirmed with CTRL+SHIFT+ENTER

    That should count instances where there are 10 or more consecutive days off

    You can expand the {"Holiday";"Study Leave"} parts to include any other "day off" options
    Audere est facere

  3. #3
    Valued Forum Contributor
    Join Date
    09-15-2011
    Location
    Chennai, India
    MS-Off Ver
    Excel 2010
    Posts
    436

    Re: Consecutive Employee Vacation Days using sumif array with frequency and column functio

    Im not sure if my answer is correct.
    Attached Files Attached Files
    Last edited by ramananhrm; 09-12-2013 at 07:46 AM.
    Please click 'Add reputation', if my answer helped you.

  4. #4
    Registered User
    Join Date
    11-16-2012
    Location
    Edinburgh
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Consecutive Employee Vacation Days using sumif array with frequency and column functio

    Thats absolutely brilliant, thanks DLL

  5. #5
    Registered User
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,160

    Re: Consecutive Employee Vacation Days using sumif array with frequency and column functio

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. Employee Time Tracking - Sick days & Consecutive Days
    By notaguru6 in forum Excel General
    Replies: 6
    Last Post: 08-09-2013, 12:50 PM
  2. Using IFERROR and FREQUENCY functions in an array
    By mcmassok in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-30-2013, 08:39 AM
  3. Vacation Days Taken vs Vacation Days Scheduled
    By Gtrtim112 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-30-2013, 02:44 PM
  4. Employee Vacation Calendar Help
    By maximus0120 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-03-2013, 05:48 PM
  5. sort employee vacation
    By orasound in forum Excel General
    Replies: 2
    Last Post: 08-09-2012, 10:56 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