HomeGoogle DocsSpreadsheetHow to Use the Frequency Function in Google Sheets

How to Use the Frequency Function in Google Sheets

Published on

This time the topic is Frequency Distribution. You can get frequency distribution with the help of a function called FREQUENCY in Sheets. Learn how to use the Frequency Function in Google Sheets.

Frequency is an Array Function that returns a vertical array result. In Google Sheets, you can use it to count the frequency of values in a range. This range is actually called a one column array.

In Google Sheets, no need to use the function ArrayFormula together with the FREQUENCY formula. Let me explain to you the use of Frequency function in Google Sheets.

Syntax:

FREQUENCY(data, classes)

Below are the details of the Arguments used in this Function.

Data: It is the one column array containing the values to be counted.

Classes: It is the range containing the set of Classes. Here you should take care of one thing. If there are multiple values, you should Sort them. In Data, it’s not applicable.

Actually, the Classes is equal to;

=sort(unique(data))

With the below formula examples, you can clearly understand the Frequency function.

Example of the Frequency Function in Google Sheets

The below is an output of a sample survey that showing the number of vehicles available in all the homes in an area.

In the below sample dataset, for frequency calculation, the function arguments are as follows.

Data: Cell reference B2: B16.

Classes: D2: D5.

Example to Frequency Distribution in Google Sheets

The formula in E2 returns the count of each Class. In this example, there are four houses with no vehicles, seven houses with 1 vehicle, three houses with 3 vehicles and one house with 4 vehicles.

To get all Classes in Cell D2 I’ve applied the below formula. It’s the Unique values in the range B2:B16 but in sorted order.

=sort(unique(B2:B16))

See one more example so that you can easily understand how to use the Frequency Function in Google Sheets.

Now I am just putting the value 2 in Cell D2 to use as the Class and changing the Class accordingly in the formula.

=FREQUENCY(B2:B16,D2)

This would return the following output.

Frequency Distribution with Single Class

There are no houses with exact 2 number of vehicles. The formula counts the number of houses with 0 vehicles and one vehicle. That means the number of houses with the count of vehicles “<=2”.

That means you can replace the above Frequency formula with a COUNTIF formula as below.

=COUNTIF(B2:B16,"<=2")

Please again refer to the first screenshot. The same formula result you can replicate by using a Query formula as below.

=query(B2:B16,"Select B, Count(B) group by B")

That’s all about Google Sheets Frequency function. Enjoy!

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Creating Sequential Dates in Equally Merged Cells in Google Sheets

Do you know how to create sequential dates in equally merged cells across a...

Running Total By Month in Excel

This tutorial demonstrates how to calculate the running total by month in a range...

SORT and SORTBY – Excel Vs Google Sheets

While Excel offers the SORT and SORTBY functions for sorting a table, Google Sheets...

Get Top N Values Using Excel’s FILTER Function

When using the FILTER function in Excel to extract the top N values, it's...

More like this

Creating Sequential Dates in Equally Merged Cells in Google Sheets

Do you know how to create sequential dates in equally merged cells across a...

Interactive Random Task Assigner in Google Sheets

You have multiple tasks and multiple people. Here's a fun way to randomly assign...

Google Sheets Bar and Column Chart with Target Coloring

To color each data point in the column or bar chart according to the...

3 COMMENTS

  1. Hello there again Prashanth! I am trying to do a similar task on google sheets but for WORD frequency… I tried your formula but it doesn’t seem to work on text strings. I did some digging and I found this here:

    =ArrayFormula(QUERY(TRANSPOSE(SPLIT(JOIN(" ";B3:B);" ")&{"";""});"select Col1, count(Col2) group by Col1 order by count(Col2) desc limit 10 label Col1 'Word', count(Col2) 'Frequency'";0))

    I found this formula at https://stackoverflow.com/questions/14307125/google-docs-spreadsheet-formula-for-most-frequent-keywords

    …it seems to get the word FREQUENCY for single words but it is not measuring multiple combinations of words.

    Is this possible with a formula in Google sheets? Thank you again so much for your time and Google Sheets WIZARDRY!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.