Select Top n Values from Excel Row

有些话、适合烂在心里 提交于 2019-12-12 00:36:03

问题


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 B18to 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!