Compute Frequency in Excel: A Complete Step-by-Step Guide
In this article
To compute frequency in Excel, use the FREQUENCY function, which calculates how often values occur within a range of values (bins). The fastest way to do this is by selecting a range of cells, typing =FREQUENCY(data_array, bins_array), and pressing Ctrl+Shift+Enter (for older Excel versions) or simply Enter (for Microsoft 365). This allows you to transform a long list of raw numbers into a structured distribution table, making it easy to see where most of your data points fall.
What You'll Need
- Microsoft Excel (all modern versions, including Office 365, 2021, 2019, and 2016).
- A dataset consisting of numerical values (the "Data Array").
- A defined set of upper limits for your intervals (the "Bins Array").
- A blank area in your spreadsheet to output the resulting frequency counts.
Step-by-Step
- Organize Your Raw Data: Ensure your primary data is in a single column or row. For example, if you are tracking test scores, place all scores in column A (A2:A100). Ensure there are no text strings or error messages within this range, as these can interfere with the mathematical calculation.
- Define Your Bin Intervals: You must create a "bins" range. Bins are the thresholds that define your groups. For example, if you want to count how many scores fall between 0-60, 61-70, 71-80, 81-90, and 91-100, you only need to list the upper limits. In column C, enter 60, 70, 80, 90, and 100 in cells C2 through C6. Excel will automatically group everything up to and including 60 in the first bin, everything from 61 to 70 in the second, and so on.
- Select the Output Range: The FREQUENCY function is an array formula, meaning it returns multiple values at once. Instead of clicking a single cell, highlight a range of empty cells adjacent to your bins. If you have 5 bins, select 6 cells (D2:D7). The extra cell is necessary because the FREQUENCY function always returns one more value than the number of bins to account for any values that exceed the highest bin limit.
- Enter the Formula: While the range is still highlighted, type the following formula without clicking away:
=FREQUENCY(A2:A100, C2:C6). Replace A2:A100 with your actual data range and C2:C6 with your bin range. - Commit the Array Formula: Depending on your version of Excel, the method to finalize the formula differs:
- Microsoft 365 or Excel 2021: Simply press Enter. Excel uses "Dynamic Arrays" and will automatically spill the results into the selected cells.
- Excel 2019 and Older: You must press Ctrl + Shift + Enter simultaneously. If you only press Enter, you will likely only see the result for the first bin. Pressing the key combination wraps the formula in curly braces { }, signaling to Excel that it is an array operation.
- Verify the Results: Check the output column. The first cell shows the count of numbers less than or equal to the first bin. The final cell shows the count of numbers that are greater than the highest bin value.
Common Mistakes
One of the most frequent errors is forgetting that the bins array represents the upper limit of each interval. Users often try to list both the start and end of a range (e.g., 0, 10, 10, 20, 20, 30), which confuses the function and leads to incorrect counts. Remember: only list the maximum value for each bracket.
Another common mistake is selecting only a single cell for the output. If you are not using a version of Excel with dynamic arrays, the formula will only return the frequency for the first bin, leaving the rest of your data uncounted. Always select the entire target range before typing the formula.
Data type mismatches are also common. If your "numbers" are actually formatted as text, the FREQUENCY function will ignore them entirely, resulting in zeros. You can check this by using the =ISNUMBER() function on a few cells to ensure Excel recognizes the data as numeric.
Finally, users often forget the "overflow" bin. If you have 10 bins, you need 11 output cells. If you only select 10, you will miss the count of any values that are higher than your maximum bin limit, which can lead to a discrepancy when you sum your frequencies against the total number of data points.
Tips
To make your frequency table more professional, use a helper column to label your bins. Instead of just showing "60," use a formula like ="0-" & C2 to display "0-60." This makes the final report much easier for other stakeholders to read.
If your data changes frequently, convert your data array and bin array into Excel Tables (Ctrl+T). By using structured references (e.g., =FREQUENCY(Table1[Scores], Table2[Bins])), the frequency calculation will automatically update whenever you add new rows to your data set, eliminating the need to manually adjust cell ranges.
For those who prefer a visual representation, the frequency data generated by this function is the perfect source for a Histogram. Select your calculated frequencies and insert a Clustered Column Chart to visualize the distribution of your data instantly.
If you find the FREQUENCY function too rigid, consider using a Pivot Table. By dragging your value field into both the "Rows" and "Values" areas and then using the "Group" feature on the row labels, you can create frequency bins dynamically without writing any formulas.
Troubleshooting
The formula only returns one value: This usually happens in older versions of Excel when the user presses Enter instead of Ctrl+Shift+Enter. To fix this, select the entire output range again, click into the formula bar, and press Ctrl+Shift+Enter.
The results are all zeros: Check your data formatting. If the numbers were imported from a CSV or another software, they might be stored as text. To fix this, select the column, go to the Data tab, select Text to Columns, and click Finish immediately. This forces Excel to re-evaluate the cell formats as numbers.
The sum of frequencies doesn't match the total count of data: First, check if you included the overflow bin (the extra cell at the bottom). If you didn't, some values are likely missing. Second, check for blank cells or non-numeric characters in your data array, as these are ignored by the FREQUENCY function.
I get a #VALUE! error: This occurs if the data array or bins array contains an error value itself (like #N/A or #DIV/0!). Clean your source data using the Find and Replace tool or the IFERROR function to remove these errors before running the frequency calculation.
Frequently Asked Questions
Can I use the FREQUENCY function for text data?
No, the FREQUENCY function is designed exclusively for numerical data. To count the frequency of text (like names or categories), use the COUNTIF or COUNTIFS functions instead.
Do my bins have to be in ascending order?
Yes, for the results to make logical sense, your bins array must be sorted from smallest to largest. If they are out of order, Excel will still calculate based on the values provided, but the resulting distribution will be fragmented and incorrect.
What is the difference between FREQUENCY and COUNTIF?
COUNTIF counts cells that meet a single specific criterion. FREQUENCY is more efficient for creating grouped distributions because it processes multiple ranges (bins) simultaneously in a single array operation.
Does the FREQUENCY function update automatically?
Yes, it is a volatile-like function in that it will recalculate whenever the underlying data in the data array or bins array is modified.
Can I use a dynamic range for my bins?
Yes, if you use a named range or an Excel Table for your bins, the function will adapt. However, if you add a new bin to the table, you must ensure the output range is expanded to accommodate the new result.