In Google Sheets, how can you find the mode of non-numerical data?

跟風遠走 提交于 2019-12-10 13:46:41

问题


If I want to find the mode of A2:A10, but my values are something like:

Foo
Foo
Bar
Foo
Baz
Bar
Foo
Bar
Foo

, what can I do?

The =MODE() function only takes numerical data, so is there a way to find the most frequent of these values? Thank you!


回答1:


Use a MATCH on a MAX(COUNTIF(...)) to a COUNTIF and pass the row position back to an INDEX.

=index(A2:A10, match(max(countif(A2:A10, A2:A10)), countif(A2:A10, A2:A10), 0))

In the case of a tie in frequency, the first in the list that matches the maximum frequency rate will be returned.

        



来源:https://stackoverflow.com/questions/35670838/in-google-sheets-how-can-you-find-the-mode-of-non-numerical-data

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