Home > front end >  G Sheet - Array Formula - count occurrences value in a list?
G Sheet - Array Formula - count occurrences value in a list?

Time:01-17

I am trying to convert the formulas below in an array formula in order to count the occurrences of a value in list of items.

Example:

data formula result
a COUNTIF($A$2:$A2,A2) 1
a COUNTIF($A$2:$A3,A3) 2
b COUNTIF($A$2:$A4,A4) 1
c COUNTIF($A$2:$A5,A5) 1
d COUNTIF($A$2:$A6,A6) 1
d COUNTIF($A$2:$A7,A7) 2

enter image description here

Any help?

CodePudding user response:

try this out:

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

enter image description here

CodePudding user response:

Try with:

=BYROW(A2:A, LAMBDA(each,COUNTIF (A2:each, each)))
  • Related