Tu PHAN
Tu PHAN

Reputation: 59

ARRAYFORMULA: COUNIF in Googlesheet

I am facing the probem of COUNTIF with ARRAYFORMULA in googlesheet as below

  1. Picture A working fine when I need to count in C.
  2. Picture B can not working with arrayformula

Any one have solution to fix it ?

Thanks alot.

enter image description here

enter image description here

Upvotes: 1

Views: 94

Answers (2)

player0
player0

Reputation: 1

use:

=INDEX(IF(A:A="",,COUNTIFS(B:B, B:B, ROW(B:B), "<="&ROW(B:B))))

enter image description here

Upvotes: 4

OneInAMillion
OneInAMillion

Reputation: 552

Sadly, CountIf can not be used like you are suggesting in an array. If you put it in an array, all values will be counted in the range. That being said, this can be achieved with a slight workaround.

=Array_Constrain(iferror(sort({row(B:B)-row(B1)+2-match(sort(B:B),sort(B:B),0),SORT(ROW(B:B)+2-row(B1)+2,B:B,1)},2,1),),9^9,1)

This formula will allow you to get a running count of the values in Column B. Have a great day!

Upvotes: 1

Related Questions