Given a column array {a;b;a;c;a;d;b} I need a formula to give the result {1;1;2;1;3;1;2}
I do not want to use a helper column.
If the array occupies (A1:A7) the required result can be obtained in C1 to C7 by dragging
=COUNTIF($A$1:A1,"="&A1)
down from C1 to C7. But I want the result to be an array.
The formula {=COUNTIF($A$1:$A$7,"="&$A$1:$A$7)} creates {$B$1:$B$7} as {3;2;3;1;3;1;2}
I am trying to create arrays in cols. B and C which look like:
a 3 1
b 2 1
a 3 2
c 1 1
a 3 3
d 1 1
b 2 2
Does anyone know any clever tricks using INDEX, MATCH, COUNTIF, SMALL for example which might achieve this?
Any suggestions would be appreciated, especially if they do not involve VBA
Bookmarks