How to count the five consecutive 'x' value within the 10 horizontal cells

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 within a horizontal range of 10 cells, such as from A1 to J1.

Your help with this Excel issue would be greatly appreciated.

Thank you.
 

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.
Hello, what version of Excel are you using + what is the desired output (e.g. whether or not there are 5 consecutive occurrences within a range or how many of them are there)?
 
Upvote 0
Good day, hagia_sofia,

I'm working on a student attendance spreadsheet and need help with a specific calculation. I want to count how many students have 5 consecutive absences, regardless of the dates they were absent. For example, if a student has 5 consecutive days marked as "home visitation", and counts as one instance, even if the absences occurred across different weeks.

Could you please help me with this calculation? Any guidance you can provide would be greatly appreciated.

Thank you.
 
Upvote 0
Regarding to the first question I'm using the version 2016. And there are 25 days/cells.
Thanks you
 
Upvote 0
Thank you for your answers! Could you also please post a sample of the data so that we could see what counts as absence and how the data is structured?
 
Upvote 0
You can try :

Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAA
112345678910111213141516171819202122232425Count
2-xxxx-xxxxxxx-xx-xx-x--x-7
3x--xxxxx--x-xxx-xxxx-x---5
4x-xx-x---xx---xxxx----x-- 
5xx--x--xxxxxx-xx-xx----xx6
6-----x-x-xxxx-xxxxx--xx-x5
7----x-xx-x--xx-----x-x-xx 
8xxxx--xx--xxxxxx-x--x-x-x6
9x--xx-xxx------x-xxx-xx-x 
10xxx--xx-xx---xx-xxx----xx 
11-----x-xx---x--x-----x-x- 
12-xxxx-x-xxxxx-xx-xx-x--x-5
Sheet1
Cell Formulas
RangeFormula
AA2:AA12AA2=LET(a,LEN(SUBSTITUTE(TEXTSPLIT(TEXTJOIN(", ",0,A2:Y2),"-"),", ","")),TEXTJOIN(", ",1,IF(a>=5,a,"")))
 
Upvote 0
Thanks a bunch Sanjeev1976
This is really helpful
 
Upvote 0
I'll try the solution. If not working then I'll let you know. Thanks foe your help..
 
Upvote 0
Welcome to the MrExcel board!
Regarding to the first question I'm using the version 2016.
Why not put that information in your profile? Makes it very hard for helpers to provide good suggestions if they do not know what resources you have available in your Excel version.
 
Upvote 0

Forum statistics

Threads
1,223,868
Messages
6,175,082
Members
452,611
Latest member
bls2024

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