Can we use a Row number as the start counter in the Countif function?

nickmsi

New Member
Joined
Jun 1, 2017
Messages
8
When we get a cell trigger, like when a "2" appears in a certain Cell I need to change the start counter in Countif as follows:

At row 15 I need something like these:

If(ao14=2,countif($A$(row15):$A15,C$5),countif($A$5:$A15,c$5)) or

If(ao14=2,countif($A$(B15):$A15,C$5,countify($A$5:$A15,C$5))

The end formula that I need is:

If(ao14=2,countif($A$15:$A15,C$5),countif($A$5:$A15,C$5))

Every time we get a 2 we need to resent the starting counter in the Countif to the next row.

Is it possible to do this?
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
I solved the problem by using a different counter as follows:

IF(AND($CI150=2,$A151=AW$4),1,IF(AND($CI150=2,$A151<>AW$4),0,IF($A151=AW$4,AW150+1,AW150)))

Cheers
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,171
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