Count two consecutive days off

hoyos

Board Regular
Joined
Jul 10, 2012
Messages
98
Office Version
  1. 365
Platform
  1. Windows
I have the following formula which I got from the forum and modified it slightly
=IF(COUNTIF(AY6:AY19,"1")>=2,"YES","NO")
Unfortunately it hasn't worked!!
What I am trying to achieve is the following: this formula is copied down column "AX". Down column "AY" has input whether a day off was taken that day by populating the cell with "1". and "0" if the individual worked. Now the formula should look at a block of 14 days previous to see if there was two consecutive days off and should indicate it with a "YES" if not then a "NO". It should only look for blocks of two days not single days. i.e if there was a block of four days then it should show with a "2" ( 2 sets of 2 consecutive days off). Appreciate any help please.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
try this, note that the arrays are offset by 1 row

Book1
AB
11YES
2
31
41
5
6
71
8
91
10
11
12
13
14
Sheet1
Cell Formulas
RangeFormula
B1B1=IF(SUMPRODUCT(A1:A14,A2:A15)>0,"YES","NO")
 
Upvote 0
Solution
Many thanks, I shall try it out over the week to see if there are any other issues and I shall get back to you.
 
Upvote 0
Thank you very much that has done the trick, works well.
 
Upvote 0

Forum statistics

Threads
1,215,006
Messages
6,122,666
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top