Adjacent Non Blank Cells

errollflynn

New Member
Joined
Jan 25, 2021
Messages
24
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have the data set below and am looking for a formula that will identify instances where there are six or more non blank, adjacent cells in a row. I've tried various forms of using counta with no success.

Thank you in advance.

Book3
ABCDEFGHIJKLM
1Sum of ShiftMonths
2Row Labels123456789101112
3Person A82528252628233028
4Person B2320212218212122
5Person C1222272524211218302319
6Person D7142528221416232615
7Person E31826251011261818
Sheet1
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Try this?
Book6
ABCDEFGHIJKLMN
1Sum of ShiftMonths
2Row Labels123456789101112
3Person A82528252628233028TRUE
4Person B2320212218212122FALSE
5Person C1222272524211218302319TRUE
6Person D7142528221416232615TRUE
7Person E31826251011261818FALSE
Sheet1
Cell Formulas
RangeFormula
N3:N7N3=OR(FREQUENCY(IF(B3:M3<>"",COLUMN(B3:M3),0),IF(B3:M3="",COLUMN(B3:M3),0))>=6)
 
Upvote 0
Try this?
Book6
ABCDEFGHIJKLMN
1Sum of ShiftMonths
2Row Labels123456789101112
3Person A82528252628233028TRUE
4Person B2320212218212122FALSE
5Person C1222272524211218302319TRUE
6Person D7142528221416232615TRUE
7Person E31826251011261818FALSE
Sheet1
Cell Formulas
RangeFormula
N3:N7N3=OR(FREQUENCY(IF(B3:M3<>"",COLUMN(B3:M3),0),IF(B3:M3="",COLUMN(B3:M3),0))>=6)


Hello,

Your solution is trending in the right direction but it seems to deliver a false positive in some instances. Please see the third line below.

aeg4_caps_payroll_report_2022-01-01_thru_2022-12-31.csv
BCDEFGHIJKLMNOP
186535323867429TRUE
187121272225427TRUE
188109166414TRUE
1891167841124324012TRUE
Sheet2
Cell Formulas
RangeFormula
O186:O189O186=COUNTA(B186:M186)
P186:P189P186=OR(FREQUENCY(IF(B186:M186<>"",COLUMN(B186:M186),0),IF(B186:M186="",COLUMN(B186:M186),0))>=6)
 
Upvote 0
Hello,

Your solution is trending in the right direction but it seems to deliver a false positive in some instances. Please see the third line below.

aeg4_caps_payroll_report_2022-01-01_thru_2022-12-31.csv
BCDEFGHIJKLMNOP
186535323867429TRUE
187121272225427TRUE
188109166414TRUE
1891167841124324012TRUE
Sheet2
Cell Formulas
RangeFormula
O186:O189O186=COUNTA(B186:M186)
P186:P189P186=OR(FREQUENCY(IF(B186:M186<>"",COLUMN(B186:M186),0),IF(B186:M186="",COLUMN(B186:M186),0))>=6)
Good point, change the zeroes to ""
Book7
BCDEFGHIJKLMNOP
186535323867429TRUE
187121272225427TRUE
188109166414FALSE
1891167841124324012TRUE
Sheet1
Cell Formulas
RangeFormula
O186:O189O186=COUNTA(B186:M186)
P186:P189P186=OR(FREQUENCY(IF(B186:M186<>"",COLUMN(B186:M186),""),IF(B186:M186="",COLUMN(B186:M186),""))>=6)
 
Upvote 0
Solution
Another simple option to consider

23 08 14.xlsm
BCDEFGHIJKLMN
382528252628233028TRUE
42320212218212122FALSE
51222272524211218302319TRUE
67142528221416232615TRUE
731826251011261818FALSE
8535323867TRUE
9121272225TRUE
10109166FALSE
11116784112432TRUE
6 or more
Cell Formulas
RangeFormula
N3:N11N3=ISNUMBER(FIND(111111,CONCAT(IF(B3:M3="",2,1))))
 
Upvote 0
That solution is certainly more compact; the real advantage my solution offers would be to find the maximum continuous adjacent cells, but that does not seem to be needed here.
 
Upvote 0
That solution is certainly more compact; the real advantage my solution offers would be to find the maximum continuous adjacent cells, but that does not seem to be needed here.

Just wait for the project creep.
 
Upvote 0
the real advantage my solution offers would be to find the maximum continuous adjacent cells,
I would still use the same basic approach - either column O or P depending on the requirement.

23 08 14.xlsm
BCDEFGHIJKLMOP
2Max consecMax consec >=6
38252825262823302877
423202122182121222 
5122227252421121830231966
6714252822141623261566
7318262510112618183 
853532386766
912127222566
101091664 
111167841124321212
6 or more
Cell Formulas
RangeFormula
O3:O11O3=MAX(LEN(TEXTSPLIT(CONCAT(IF(B3:M3="",2,1)),2)))
P3:P11P3=LET(m,MAX(LEN(TEXTSPLIT(CONCAT(IF(B3:M3="",2,1)),2))),IF(m>5,m,""))
 
Upvote 0
Another simple option to consider

23 08 14.xlsm
BCDEFGHIJKLMN
382528252628233028TRUE
42320212218212122FALSE
51222272524211218302319TRUE
67142528221416232615TRUE
731826251011261818FALSE
8535323867TRUE
9121272225TRUE
10109166FALSE
11116784112432TRUE
6 or more
Cell Formulas
RangeFormula
N3:N11N3=ISNUMBER(FIND(111111,CONCAT(IF(B3:M3="",2,1))))
Another fascinating solution! Thank you!
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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