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?

Thank you.
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?

Thank you.
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)))