Rahul
Rahul

Reputation: 21

counting unique row values in excel

I have product list like this. I have only product name list

Apple       1
Apple       1
Apple       1
Orange      2
Orange      2
Orange      2
Mango       3
Mango       3
Pineapple   4
Pineapple   4
Pineapple   4
Pineapple   4
Pineapple   4
Pineapple   4
Avocado     5

I want to count data in this way. please help.

Upvotes: 1

Views: 43

Answers (2)

user4039065
user4039065

Reputation:

Put 1 in B1 then put this formula in B2,

=if(a2<>a1, max(b$1:b1)+1, b1)

... and fill down.

Alternately just put his formula into B1,

=SUMPRODUCT(1/(COUNTIF(A$1:A1,A$1:A1)))

... and fill down.

Upvotes: 1

zipa
zipa

Reputation: 27869

In B1 insert 1 and in B2 insert:

=IF(A2=A1,B1,B1+1)

And from there just fill.

Upvotes: 1

Related Questions