How to use ARRAYFORMULA to count unique?

Viewed 41

In Google Sheets, I would like to count how many times the unique data appeared.

How can I get the result of Column C by using arrayformula?

enter image description here

Thank you.

1 Answers

Here is one way - maybe there is a shorter one?

=ArrayFormula(if(A2:A="",,vlookup(row(A2:A),
{query({row(A2:A),A2:A},"select min(Col1), Col2 where Col2 is not null group by Col2 label min(Col1) ''"),
sequence(countunique(A2:A))},3)))

enter image description here

Related