I'd like to get a sorted list of all unique values in the given range. Just sort numbers like text (they also happen to be stored as text). Like below:
Source:
AA
<BLANK>(blank)
B6
01
31
AA
21
<BLANK>(blank)
1A
2Z
01
Result:
01
1A
21
2Z
31
AA
B6</BLANK></BLANK>
This is a difficult case for CountIf formulation. What follows makes use of intermediate steps in order to cope with blanks and text numbers...
[TABLE="width: 228"]
<COLGROUP><COL style="WIDTH: 48pt" span=2 width=64><COL style="WIDTH: 67pt; mso-width-source: userset; mso-width-alt: 3185" width=90><COL style="WIDTH: 65pt; mso-width-source: userset; mso-width-alt: 3072" width=86><TBODY>[TR]
[TD="class: xl63, width: 64, bgcolor: transparent"] [/TD]
[TD="class: xl63, width: 64, bgcolor: transparent"]
No blanks[/TD]
[TD="class: xl63, width: 90, bgcolor: transparent, align: right"]
9[/TD]
[TD="class: xl63, width: 86, bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: transparent"]
AA[/TD]
[TD="class: xl63, bgcolor: transparent"]
AA[/TD]
[TD="class: xl63, bgcolor: transparent"]
#intermediate[/TD]
[TD="class: xl63, bgcolor: transparent"]
#Sorted[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: transparent"] [/TD]
[TD="class: xl63, bgcolor: transparent"]
B6[/TD]
[TD="class: xl63, bgcolor: transparent"]
@01[/TD]
[TD="class: xl63, bgcolor: transparent"]
01[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: transparent"]
B6[/TD]
[TD="class: xl63, bgcolor: transparent"]
@01[/TD]
[TD="class: xl63, bgcolor: transparent"]
@1A[/TD]
[TD="class: xl63, bgcolor: transparent"]
1A[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: transparent"]
01[/TD]
[TD="class: xl63, bgcolor: transparent"]
@31[/TD]
[TD="class: xl63, bgcolor: transparent"]
@21[/TD]
[TD="class: xl63, bgcolor: transparent"]
21[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: transparent"]
31[/TD]
[TD="class: xl63, bgcolor: transparent"]
AA[/TD]
[TD="class: xl63, bgcolor: transparent"]
@2Z[/TD]
[TD="class: xl63, bgcolor: transparent"]
2Z[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: transparent"]
AA[/TD]
[TD="class: xl63, bgcolor: transparent"]
@21[/TD]
[TD="class: xl63, bgcolor: transparent"]
@31[/TD]
[TD="class: xl63, bgcolor: transparent"]
31[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: transparent"]
21[/TD]
[TD="class: xl63, bgcolor: transparent"]
@1A[/TD]
[TD="class: xl63, bgcolor: transparent"]
AA[/TD]
[TD="class: xl63, bgcolor: transparent"]
AA[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: transparent"] [/TD]
[TD="class: xl63, bgcolor: transparent"]
@2Z[/TD]
[TD="class: xl63, bgcolor: transparent"]
B6[/TD]
[TD="class: xl63, bgcolor: transparent"]
B6[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: transparent"]
1A[/TD]
[TD="class: xl63, bgcolor: transparent"]
@01[/TD]
[TD="class: xl63, bgcolor: transparent"] [/TD]
[TD="class: xl63, bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: transparent"]
2Z[/TD]
[TD="class: xl63, bgcolor: transparent"]
##[/TD]
[TD="class: xl63, bgcolor: transparent"] [/TD]
[TD="class: xl63, bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: transparent"]
01[/TD]
[TD="class: xl63, bgcolor: transparent"]
##[/TD]
[TD="class: xl63, bgcolor: transparent"] [/TD]
[TD="class: xl63, bgcolor: transparent"] [/TD]
[/TR]
</TBODY>[/TABLE]
B2, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IFERROR(INDEX(IF(ISNUMBER(LEFT($A$2:$A$12)+0),"@"&$A$2:$A$12,$A$2:$A$12),
SMALL(IF(1-($A$2:$A$12=""),ROW($A$2:$A$12)-ROW($A$2)+1),ROWS($B$2:B2))),"##")
C1, just enter:
Rich (BB code):
=MATCH("##",$B$2:$B$12,0)-1
C3, control+shift+enter and copy down:
Rich (BB code):
=IFERROR(INDEX($B$2:INDEX($B$2:$B$12,$C$1),
MATCH(0,COUNTIF($B$2:INDEX($B$2:$B$12,$C$1),
"<"&$B$2:INDEX($B$2:$B$12,$C$1))-
SUM(COUNTIF($B$2:INDEX($B$2:$B$12,$C$1),"="&C$2:C2)),0)),"")
D3, just enter and copy down:
Rich (BB code):
=IF($C3="","",SUBSTITUTE($C3,"@",""))