问题
I'm struggling tremendously with this problem. I have a row (B14:CW15) of integers that count how many times each unique string occurs within the original string. It is structured like so.
Biagrams: +h hb bl I) )m mj jk km mm mk k^ mm +h
Unique Biagrams: +h hb bl I) )m mj jk km mm mk k^
Biagram Count: 2 1 1 1 1 1 1 1 2 1 1
I can't for the life of my figure out how I can extract the top n biagrams from this without excel selecting duplicate biagrams. The Large() function has not worked as it will return the same biagram for each number, not unique biagrams for the same number.
回答1:
So you need to calculate the rank of the counts and the sort by rank:
Formulas:
in B16
to right:
=COUNTIF($14:$14,B$15)
in B17
to right:
=RANK.EQ(B$16,$B$16:$CW$16)
in B18
to right:
{=INDEX($A$15:$CW$15,,--RIGHT(SMALL(RANK.EQ($B$16:$CW$16,$B$16:$CW$16,0)*10^5+COLUMN($B$16:$CW$16),COLUMNS($A:A)),5))}
The last formula is an array formula. Input it into the cell without the curly brackets and press [Ctrl]+[Shift]+[Enter] to confirm. The curly brackets will then appear automatically.
来源:https://stackoverflow.com/questions/36660620/select-top-n-values-from-excel-row