DushiPunda
Well-known Member
- Joined
- Nov 14, 2015
- Messages
- 518
- Office Version
- 2021
- Platform
- Windows
Hello,
I'm looking for a way to count the number of times TWO consecutive blanks cells occur on my spreadsheet (work schedule) here is an example of the intended output:
The data I need to look at exists in columns B:AF; currently I have a bunch of hidden helper cells using the following formulas:
Starting with:
Ending with:
Basically looking at consecutive 4 day chunks from the schedule.
The issue: If there are any ONE day breaks, these are counted as 2 TWO day breaks, whereas they should be counted as 1 TWO day break. Below is a copy of the above example with the outputs that I'm currently getting.
I tried to solve this by using an imbedded IF to look at the next helper cell's 4 day reference and came up with this (not really sure how this logic works, but it's checked out in my testing):
Starting with:
Ending with:
This has largely solved my issues, but gets a little janky if there is a one day break at the end of the month.
Surely there is an easier way to do this? Thanks!
I'm looking for a way to count the number of times TWO consecutive blanks cells occur on my spreadsheet (work schedule) here is an example of the intended output:
| B | C | D | E | F | G | H | I | .. | AD | AE | AF | AK |
1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | .. | 29 | 30 | 31 | # 2 Days |
2 | 24 | | 24 | | 24 | | 24 | | .. | 24 | | 24 | 4 |
3 | 24 | | | 24 | | | 24 | | .. | | | 24 | 2 |
4 | 24 | | | 24 | | | | 24 | .. | | 24 | | 1 |
The data I need to look at exists in columns B:AF; currently I have a bunch of hidden helper cells using the following formulas:
Starting with:
Excel Formula:
=IF(COUNTIF(B6:E6,24)>=2,1,0)
Excel Formula:
=IF(COUNTIF(AC6:AC6,24)>=2,1,0)
Basically looking at consecutive 4 day chunks from the schedule.
The issue: If there are any ONE day breaks, these are counted as 2 TWO day breaks, whereas they should be counted as 1 TWO day break. Below is a copy of the above example with the outputs that I'm currently getting.
B | C | D | E | F | G | H | I | .. | AD | AE | AF | AK | |
1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | .. | 29 | 30 | 31 | # 2 Days |
2 | 24 | 24 | 24 | 24 | .. | 24 | 24 | 8 | |||||
3 | 24 | 24 | 24 | .. | 24 | 2 | |||||||
4 | 24 | 24 | 24 | .. | 24 | 1 |
I tried to solve this by using an imbedded IF to look at the next helper cell's 4 day reference and came up with this (not really sure how this logic works, but it's checked out in my testing):
Starting with:
Excel Formula:
=IF(AND(COUNTIF(B6:E6,24)>=2,COUNTIF(C6:F6,24)>=2),0,IF(AND(COUNTIF(B6:E6,24)>=2,COUNTIF(C6:F6,24)<>2),1,0))
Excel Formula:
=IF(AND(COUNTIF(AC6:AF6,24)>=2,COUNTIF(AD6:AG6,24)>=2),0,IF(AND(COUNTIF(AC6:AF6,24)>=2,COUNTIF(AD6:AG6,24)<>2),1,0))
This has largely solved my issues, but gets a little janky if there is a one day break at the end of the month.
Surely there is an easier way to do this? Thanks!
Last edited: