Counting rows sequentially if a certain value exists in another column

Darnell7007

New Member
Joined
Mar 11, 2025
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hello!

I am trying to count rows sequentially in column A, only if the formula COUNTIF returns a value of "1" in column B. If the COUNTIF formula returns a value of "0", I'd like column A to remain blank - or worst case, enter FALSE.
I've attached a sample of data below.

I've played around with a few formulas and ideas, but I can't get it to count sequentially, only to return a value of "1" in column A if there's a value of "1" in column B.

1741701273058.png

Sequential CountCOUNTIF
0
0
11
0
0
0
21
0
31
41
0
0
51
0
61
0
0
 
Hi & welcome to MrExcel.
How about either of these
Fluff.xlsm
ABC
1Sequential CountCOUNTIF
2 0 
3 0
4111
5 0
6 0
7 0
8212
9 0
10313
11414
12 0
13 0
14515
15 0
16616
17 0
18 0
19
Data
Cell Formulas
RangeFormula
C2:C18C2=MAP(B2:B18,LAMBDA(m,IF(m=1,COUNTIFS(B2:m,1),"")))
A2:A18A2=IF(B2=1,COUNTIFS(B$2:B2,1),"")
Dynamic array formulas.
 
Upvote 0
Solution
Hi & welcome to MrExcel.
How about either of these
Fluff.xlsm
ABC
1Sequential CountCOUNTIF
2 0 
3 0
4111
5 0
6 0
7 0
8212
9 0
10313
11414
12 0
13 0
14515
15 0
16616
17 0
18 0
19
Data
Cell Formulas
RangeFormula
C2:C18C2=MAP(B2:B18,LAMBDA(m,IF(m=1,COUNTIFS(B2:m,1),"")))
A2:A18A2=IF(B2=1,COUNTIFS(B$2:B2,1),"")
Dynamic array formulas.
Hello - thank you so much for your help!

Your second formula is exactly what I needed and it's working beautifully! Have a great rest of your day!!!
 
Upvote 0

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