Count rows sequentially, where it recounts again when a undesired input was given.

saman018

New Member
Joined
Aug 5, 2022
Messages
6
Office Version
  1. 2021
Platform
  1. Windows
Does anybody know how to make excel count rows sequentially. Where if there is a different text, it will stop counting to that number until a desired text is given?
like for example at A2 to F2, has two possible letters to be inputted. First excel counted 2 As from A2 to B2, however it stopped because B was inputted. Then finally it counted 3 As from D2 to F2.
It can vba or formula.
Thank you very much in advance.
 

Attachments

  • Screenshot 2022-08-06 160204.jpg
    Screenshot 2022-08-06 160204.jpg
    10.8 KB · Views: 8

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
How do you want the results displayed? Here's one option:

Book1
ABCDEF
1MondayTuesdayWednesdayTHURSDAYFRIDAYSATURDAY
2AABAAA
3
4121123
Sheet2
Cell Formulas
RangeFormula
B4:F4B4=IF(B2=A2,A4+1,1)
 
Upvote 0
THANK that works like a charm, i needed to tweak it a bit to fit all my conditions, but you lead me to the right path of thinking. Do you happen to know if there is a formula for conditional formatting that indicates if the count reaches to the value of 4 then the cell next to it (at the main row) needs to be highlighted.
 
Upvote 0
Maybe:

Book1
ABCDEFGHIJKL
1MondayTuesdayWednesdayTHURSDAYFRIDAYSATURDAYSundayMondayTuesdayWednesdayThursdayFriday
2AABAAAABBBBB
3
4121123412345
Sheet2
Cell Formulas
RangeFormula
B4:L4B4=IF(B2=A2,A4+1,1)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:N2Expression=A4=4textNO
 
Upvote 0
Solution

Forum statistics

Threads
1,224,813
Messages
6,181,118
Members
453,021
Latest member
Justyna P

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