Consecutive marks

mellorjay

New Member
Joined
Jan 28, 2025
Messages
3
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
  3. Web
Hello, i am after a formula that will allow me to count how many cells in a row contain the same value. Basically i am wanting to make an attendance streak calculator for my classroom. This will allow me to see how many days in a row each student has been in school. Any AI response is not making it clear how i would do this so after real humans to help :).

For this to work for the entire academic year i feel i will need to add a start date to work this out from.

Students are given a mark each day they are in as either '100%' or a forward slash '/' so have options in how to calculate this.

Thanks in advance
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Hi, welcome to the forum! I think it would help if you were able to show us an example of your data and layout and show us what results you would expect for that sample data.

You can read about one way to do that here.

In the meantime, this might give you some ideas.

Book3
ABCDEFGHIJKLMNOPQRST
1StudentLongest Streak
2Student 1/////////////6
3Student 2//////3
4Student 30
5Student 4///////////4
6Student 5//////////////////18
Sheet1
Cell Formulas
RangeFormula
T2:T6T2=MAX(SCAN(0,B2:S2,LAMBDA(a,b,IF(b="/",a+1,a*0))))
 
Upvote 0
Hi, welcome to the forum! I think it would help if you were able to show us an example of your data and layout and show us what results you would expect for that sample data.

You can read about one way to do that here.

In the meantime, this might give you some ideas.

Book3
ABCDEFGHIJKLMNOPQRST
1StudentLongest Streak
2Student 1/////////////6
3Student 2//////3
4Student 30
5Student 4///////////4
6Student 5//////////////////18
Sheet1
Cell Formulas
RangeFormula
T2:T6T2=MAX(SCAN(0,B2:S2,LAMBDA(a,b,IF(b="/",a+1,a*0))))
Hi thanks for this it looks perfect. I have tried to copy your formula and i cannot get it to work for some reason. i have never come across the LAMBDA function before what is this?
 
Upvote 0
Is this any good? This seems to work on a small piece of test data, count the maximum consecutive non blanks from columns B to S.
Something I found online years ago.
NOTE: This needs to be an array formula

=MAX(FREQUENCY(IF(B1:S1<>"",COLUMN(B1:S1)),IF(B1:S1="",COLUMN(B1:S1))))
 
Upvote 0
What happens when you try? An error when trying to commit the formula? (if so, what's the error). It's returning an error? (if so, again what error?), it's returning a wrong result? Something else?


See here and here.
Thanks i am not sure why, i have closed and opened Excel and has worked thanks!
 
Upvote 0

Forum statistics

Threads
1,226,113
Messages
6,189,048
Members
453,522
Latest member
Seeker2025

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