1
votes

I'm new to Google Sheets. I try to count values in column A using ArrayFormula and CountIf, but the result is not I want.

I try in each row with this

=COUNTIF($A$2:A2,A2)

so each row will count values from A2 until the row appears.

But if I try with arrayformula, the result is different

=ARRAYFORMULA(COUNTIF($A$2:A,A2:A))

Screenshot of result

This is my spreadsheets

Please Help me,

1

1 Answers

1
votes
=ARRAYFORMULA(IF(LEN(A2:A), COUNTIFS(A2:A, A2:A, ROW(A2:A), "<="&ROW(A2:A)), ))

0