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

1. ## 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

2. ## 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

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

Im not sure if my answer is correct.

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

Thats absolutely brilliant, thanks DLL

5. ## 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 -

Incase your issue is not solved, you can undo it as follows -

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.

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

#### 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