functionmathgoogle-sheetsformulas

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


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!


Solution

  • 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.

            google-sheets_max_text_frequency