DushiPunda
Well-known Member
- Joined
- Nov 14, 2015
- Messages
- 518
- Office Version
- 2021
- Platform
- Windows
Hello,
I'm revisiting an old problem - last thread here: Counting Consecutive Blanks
I'll try to explain the best I can.
The bottom line is - I want to count the number of times there are only 1 or 2 cells (blank or not) in between two cells that contain "24".
Here's a sample of my work schedule:
The column of concern is AJ ("2 DAYS"). Some notes:
The current array formula I'm using (I couldn't get the formula from my prior post to work at all):
I found this formula here and modified it to fit my needs (sorta). I am a complete novice when it comes to array formulas, but what I tried to make it do (and it does for the most part) SUM the number of times there are 2 blanks cells with the number of times there is 1 blank cell.
Though it didn't work, I tried the following to account for "non-blank, non-24" values:
Instead of looking at blank and non-blank cells as my first formula appears to be doing, I figured this would look at cells that are or are not equal to 24, counting the number of cells that aren't 24, and returning to me the amount of times there are 2 consecutive or 1 "non-24" in between cells that are 24.
Any help is sincerely appreciated!
I'm revisiting an old problem - last thread here: Counting Consecutive Blanks
I'll try to explain the best I can.
The bottom line is - I want to count the number of times there are only 1 or 2 cells (blank or not) in between two cells that contain "24".
Here's a sample of my work schedule:
The column of concern is AJ ("2 DAYS"). Some notes:
- As you can see from Row 4, "24" is not the only possible value of cells. The expected output (see below) is 3 - so my formula (also below) is counting the L's.
- Row 5 is a little weird because it's giving an output of 2, while is should be one. This oddity only happens when one of the "24" is in one of the following columns: D, E, AE, AF. For more context - If I put a single "24" in one of those columns, it counts it as a "2 DAY" (i.e. it will put "1" in column AJ). So if I then add another "24" with 1 or 2 cells in between the previous, it will add 1 and give me 2.
- Rows 6 & 7 are further showcasing the issue explained in #2.
Row | 2 DAYS |
4 | 3 |
5 | 1 |
6 | 4 |
7 | 4 |
The current array formula I'm using (I couldn't get the formula from my prior post to work at all):
Excel Formula:
{=SUM(IF(FREQUENCY(IF(C4:AG4="",COLUMN(C4:AG4)),IF(C4:AG4<>"",COLUMN(C4:AG4)))=2,1,0))+SUM(IF(FREQUENCY(IF(C4:AG4="",COLUMN(C4:AG4)),IF(C4:AG4<>"",COLUMN(C4:AG4)))=1,1,0))}
I found this formula here and modified it to fit my needs (sorta). I am a complete novice when it comes to array formulas, but what I tried to make it do (and it does for the most part) SUM the number of times there are 2 blanks cells with the number of times there is 1 blank cell.
Though it didn't work, I tried the following to account for "non-blank, non-24" values:
Excel Formula:
{=SUM(IF(FREQUENCY(IF(C4:AG4=24,COLUMN(C4:AG4)),IF(C4:AG4<>24,COLUMN(C4:AG4)))=2,1,0))+SUM(IF(FREQUENCY(IF(C4:AG4=24,COLUMN(C4:AG4)),IF(C4:AG4<>24,COLUMN(C4:AG4)))=1,1,0))}
Instead of looking at blank and non-blank cells as my first formula appears to be doing, I figured this would look at cells that are or are not equal to 24, counting the number of cells that aren't 24, and returning to me the amount of times there are 2 consecutive or 1 "non-24" in between cells that are 24.
Any help is sincerely appreciated!