Count the 5 consecutive 'x' in excel 2016

luck99

New Member
Joined
Aug 31, 2024
Messages
7
Office Version
  1. Prefer Not To Say
Platform
  1. Windows
Hello everyone,

I need assistance with an Excel problem.

I would like to count the occurrences of 5 consecutive 'x' values.

Your help with this Excel issue would be greatly appreciated.

Thank you.
Here is the sample format
Version of my excel is
Excel 2016
 

Attachments

  • Messenger_creation_945B0D04-A93A-43A4-8C17-F5B5458D9C83.jpeg
    Messenger_creation_945B0D04-A93A-43A4-8C17-F5B5458D9C83.jpeg
    29.3 KB · Views: 14

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
I have a solution but I don't know if it works on the "Prefer Not To Say" version.
 
Upvote 0

Mark.
That is my answer to a polite request that was made in Post #10 and totally ignored.

I am not a moderator or administrator so I can't say what I think should be said to try to make people be polite to helpers that spend their time to solve problems for people in need.
 
Upvote 0
You can try the below solution :

Book1
ABCDEFGHIJKLMNOPQRS
1sample only september
2daysMTWТНFMTWТНFMTWТНFABSENT5 CONSECUTIVE ABSENCESRemarks
3Emp 1xxxxx51REPORT
4Emp 2xxxxx5
5Emp 3xxxxxxxxxxx111REPORT
Sheet2
Cell Formulas
RangeFormula
Q3:Q5Q3=COUNTA(B3:P3)
R3:R5R3=IF(ISNUMBER(SEARCH("xxxxx", IF(B3=""," ",B3) & IF(C3=""," ",C3) & IF(D3=""," ",D3) & IF(E3=""," ",E3) & IF(F3=""," ",F3) & IF(G3=""," ",G3) & IF(H3=""," ",H3) & IF(I3=""," ",I3) & IF(J3=""," ",J3) & IF(K3=""," ",K3) & IF(L3=""," ",L3) & IF(M3=""," ",M3) & IF(N3=""," ",N3) & IF(O3=""," ",O3) & IF(P3=""," ",P3))), 1, " ")
 
Upvote 0
Try this:

Book1
ABCDEFGHIJKLMNOPQRS
1sample only september
2daysMTWТНFMTWТНFMTWТНFABSENT5 CONSECUTIVE ABSENCESRemarks
3Emp 1xxxxx51REPORT
4Emp 2xxxxx50
5Emp 3xxxxxxxxxxx111REPORT
Sheet1
Cell Formulas
RangeFormula
Q3:Q5Q3=COUNTIF(B3:P3,"X")
R3:R5R3=SUMPRODUCT(--(FREQUENCY(COLUMN(B3:P3),IF(B3:P3<>"X",COLUMN(B3:P3)))>4))
 
Upvote 0
Try this:

Book1
ABCDEFGHIJKLMNOPQRS
1sample only september
2daysMTWТНFMTWТНFMTWТНFABSENT5 CONSECUTIVE ABSENCESRemarks
3Emp 1xxxxx51REPORT
4Emp 2xxxxx50
5Emp 3xxxxxxxxxxx111REPORT
Sheet1
Cell Formulas
RangeFormula
Q3:Q5Q3=COUNTIF(B3:P3,"X")
R3:R5R3=SUMPRODUCT(--(FREQUENCY(COLUMN(B3:P3),IF(B3:P3<>"X",COLUMN(B3:P3)))>4))
Hi Phuoc :

Your solution does not give the correct results :

Book4
ABCDEFGHIJKLMNOPQR
2daysMTWТНFMTWТНFMTWТНFABSENT5 CONSECUTIVE ABSENCES
3Emp 1xxxxx51
Sheet1
Cell Formulas
RangeFormula
Q3Q3=COUNTIF(B3:P3,"X")
R3R3=SUMPRODUCT(--(FREQUENCY(COLUMN(B3:P3),IF(B3:P3<>"X",COLUMN(B3:P3)))>4))
 
Upvote 0
Your solution does not give the correct results :
@Sanjeev1976 can you test the below please
Excel Formula:
=SUMPRODUCT(--(FREQUENCY(COLUMN($B$1:$P$1),IF($B2:$P2<>"X",COLUMN($B$1:$P$1))-1)>4))

Edited to match the cell references in Sanjeev's table in post 5
 
Last edited:
Upvote 0
Hi Phuoc :

Your solution does not give the correct results :
I don't think yours does either does it? Wouldn't this be 2?
(Also, I think returning a space character " " as a null result is a generally a bad idea)

24 09 03.xlsm
BCDEFGHIJKLMNOPQR
2MTWТНFMTWТНFMTWТНFABSENT5 CONSECUTIVE ABSENCES
3xxxxxxxxxx101
5 Consecutive
Cell Formulas
RangeFormula
Q3Q3=COUNTA(B3:P3)
R3R3=IF(ISNUMBER(SEARCH("xxxxx", IF(B3=""," ",B3) & IF(C3=""," ",C3) & IF(D3=""," ",D3) & IF(E3=""," ",E3) & IF(F3=""," ",F3) & IF(G3=""," ",G3) & IF(H3=""," ",H3) & IF(I3=""," ",I3) & IF(J3=""," ",J3) & IF(K3=""," ",K3) & IF(L3=""," ",L3) & IF(M3=""," ",M3) & IF(N3=""," ",N3) & IF(O3=""," ",O3) & IF(P3=""," ",P3))), 1, " ")



@luck99 what do you want returned for 10 consecutive days absent?
@luck99
As well as Mark's question, what about even 6 consecutive?

For counting 5 consecutive, for you is the below example ..
  • 0 because it is 6 consecutive not 5 consecutive, or
  • 1 because it is one group of at least 5, or
  • 2 because there is 5 consecutive from D3:H3 and there is 5 consecutive from E3:I3
(I'm also interested to see a response to my question in you other thread)

24 09 03.xlsm
BCDEFGHIJKLMNOP
2MTWТНFMTWТНFMTWТНF
3xxxxxx
5 Consecutive
 
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,791
Members
451,589
Latest member
Harold14

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