How to Use the FREQUENCY Function in Google Sheets

This time, we’ll explore frequency distribution using the FREQUENCY function in Google Sheets. You’ll learn how to utilize this function effectively.

What is Frequency?

Frequency is an array function that returns a vertical array of results. In Google Sheets, you can use it to count the frequency of values in a specified range, which is referred to as a one-column array.

You do not need to combine the FREQUENCY function with the ARRAYFORMULA function in Google Sheets. Let’s dive into the usage of the FREQUENCY function.

FREQUENCY Function: Syntax and Arguments

Syntax:

FREQUENCY(data, classes)

Argument Details:

  • data: A one-column array containing the values to be counted.
  • classes: A range that defines the set of classes. Ensure that if there are multiple values, you sort them. You do not need to sort the data.

The result of the FREQUENCY function will be a vertical range one row larger than the number of classes. The last value in this range represents the count of elements in the data that exceed all class boundaries.

The classes can be defined as follows:

=SORT(UNIQUE(data))

Example of the FREQUENCY Function in Google Sheets

Below is an example output from a sample survey showing the number of vehicles available in homes within a specific area.

Frequency distribution of cars in households

In this sample dataset, the function arguments for frequency calculation are:

  • data: Cell range B2:B16
  • classes: Cell range D2:D5

The formula in cell E2 returns the count for each class. In this example, there are four homes with no vehicles, seven homes with one vehicle, three homes with two vehicles, and one home with four vehicles.

To generate all classes in cell D2, I applied the following formula, which retrieves unique values from the range B2:B16 in sorted order:

=SORT(UNIQUE(B2:B16))

Another Example for Better Understanding

Now, let’s put the value 2 in cell D2 as the class and adjust the formula accordingly:

=FREQUENCY(B2:B16, D2)

This will yield the following output:

Additional tips for frequency distribution

There are no houses with exactly two vehicles. The formula counts the number of houses with zero vehicles and one vehicle, effectively counting the number of houses with vehicles less than or equal to two.

You can replace the above FREQUENCY formula with a COUNTIF formula as follows:

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

Refer back to the first screenshot for verification. You can achieve the same result using a QUERY formula:

=QUERY(B2:B16, "SELECT B, COUNT(B) GROUP BY B")

That’s all about the FREQUENCY function in Google Sheets. Enjoy exploring its capabilities!

Resources

The FREQUENCY function is widely used for identifying winning or losing streaks in Google Sheets. Here are a few tutorials related to that:

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.

Sort Data but Keep Blank Rows in Excel and Google Sheets

Using a dynamic array formula or the FILTER command, we can sort data and...

Lookup Values Under Categories in Excel and Google Sheets

We can use a combination of XLOOKUP and VLOOKUP in both Excel and Google...

Extract Items Under a Category from the Same Column in Excel

In Excel, you can use a combination of the XLOOKUP and DROP functions to...

How to Create a Searchable Table in Excel Using the FILTER Function

Finding specific records, or rows containing the required information, is straightforward in Excel using...

More like this

XMATCH Row by Row: Finding Values Across a Range in Google Sheets

Using the BYROW function with XMATCH in Google Sheets allows us to match values...

Limit Formula Expansion to a Specific Row in Google Sheets

In this tutorial, I’ll explain how to limit the expansion of an array formula...

3-D Referencing Structured Data Tables in Google Sheets

When you have several tables within a single sheet—not across multiple sheets in a...

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.