Hi Everyone,
Assume we have a list of letters/words in A2:A11 and we want to show in B2 and down all unique values from A2:A11 in alphabetic order. This can be achieved using in B2 this array-entered formula: =INDEX($A$2:$A$11,MATCH(0,COUNTIF($A$2:$A$11,"<"&$A$2:$A$11)-SUM(COUNTIF($A$2:$A$11,"="&B$1:B1)),0))
I tried to figure out how this formula works but I couldn't. I understand this part only COUNTIF($A$2:$A$11,"<"&$A$2:$A$11). COUNTIF($A$2:$A$11,"="&B$1:B1)) seems to be a circular reference to me and I have no idea how to crack this formula from here...
I managed to write a formula that will do A-Z sorting but listing all values, duplicates will be included - arrayed entered in:
=INDEX($A$2:$A$11,MATCH(SMALL(COUNTIF($A$2:$A$11,"<"&$A$2:$A$11),ROW()-1),COUNTIF($A$2:$A$11,"<"&$A$2:$A$11),0))
and I manged to write a formula that will return unique values in alphabetical order, but using one extra helping column:
helping formula in D2: =IF(COUNTIF(A2:$A$11,A2)>1,"x",COUNTIF($A$2:$A$11,"<"&$A$2:$A$11))
final formula - array entered: =INDEX($A$2:$A$11,MATCH(SMALL(COUNTIF($A$2:$A$11,"<"&$A$2:$A$11),ROW()-1),$D$2:$D$11,0))
If anyone could help me with the folloing question that would be great:
1) Please explain step by step how the original formula works
2) I wrote a formula that will return exactly the same result as original formula, but I need to use a helping column. Why nesting the helping coulmn into the final formula doesn't work the same way as keeping both formulas separate? The final formula will look like that - array entered: =INDEX($A$2:$A$11,MATCH(SMALL(COUNTIF($A$2:$A$11,"<"&$A$2:$A$11),ROW()-1),IF(COUNTIF(A2:$A$11,A2)>1,"x",COUNTIF($A$2:$A$11,"<"&$A$2:$A$11))))
And it almost works, except it returns error for duplicated values. Any idea how to fix it?
3)How come COUNTIF($A$2:$A$11,"<"&$A$2:$A$11) expression entered in let's say H2:H11 returns different values for different rows? The formula looks exactly the same in each cell, all references are absolute.
Thanks
tmk221
Bookmarks