FREQUENCY Function: Create Histograms & Binned Distributions

FREQUENCY function in Excel — histogram bar chart showing bin counts of {14, 31, 28, 19, 8} across four bins plus overflow, with a frequency table showing relative and cumulative percentages, key formulas, and bin boundary logic diagram.
A list of 500 numbers tells you almost nothing at a glance. Group them into bins and the shape of the distribution becomes immediately visible — where values cluster, where they thin out, and whether the data skews left or right. The FREQUENCY function performs that grouping in a single formula. This guide covers eight practical examples: building a basic frequency table, charting it as a histogram with gap width set to zero, converting counts to relative frequencies and cumulative percentages, generating dynamic bins with SEQUENCE that update as data changes, counting students per grade band, measuring manufacturing defect rates across tolerance zones, comparing two distributions side-by-side, and using the FREQUENCY distinct-count trick to find unique values. It also covers the key behaviour most analysts miss: FREQUENCY always returns one more value than the number of bin boundaries — that extra row is the overflow bucket, and forgetting it silently drops data.

A list of 500 sales figures tells you almost nothing at a glance. Group those figures into bins — 0–100, 101–200, 201–300 — and suddenly you see the shape of the distribution: where the values cluster, where they thin out, whether the data is skewed left or right. The FREQUENCY function performs that grouping in a single formula. It counts how many values fall into each bin and returns the counts as a vertical array. Those counts are the foundation of every histogram, distribution report, and binned analysis in Excel.

This guide covers the full FREQUENCY syntax, the bin boundary logic, and eight practical examples. You will learn how to build a basic frequency table, chart it as a histogram, calculate relative frequencies and cumulative percentages, create dynamic bins that update as data changes, and use FREQUENCY for grade banding and quality control. Each example also includes the Excel 365 spill approach and the Ctrl+Shift+Enter method for older versions.

Availability: FREQUENCY is available in all Excel versions, including Microsoft 365, Excel 2024, 2021, 2019, 2016, and earlier. It also works in Google Sheets. In Excel 2019 and earlier, FREQUENCY requires Ctrl+Shift+Enter as an array formula. In Excel 365 and 2021, it spills automatically into as many rows as needed.

What Does FREQUENCY Do?

FREQUENCY counts how many values in a dataset fall within each interval defined by a set of bin boundaries. Specifically, each bin captures values greater than the previous boundary up to and including the current boundary. For example, a bin boundary of 50 captures all values from the previous boundary (exclusive) up to and including 50. The first bin captures everything from negative infinity up to the first boundary value.

The function always returns one more value than the number of bin boundaries. The extra value at the end counts everything above the highest boundary — an overflow bucket. This is a distinctive behaviour that catches analysts off guard. If you define five bin boundaries, FREQUENCY returns six counts. The sixth count tells you how many values exceeded the largest bin.

What Is the FREQUENCY Syntax?

=FREQUENCY(data_array, bins_array)
ArgumentRequired?What it does
data_arrayRequiredThe values to count. A range or array of numbers. Text and empty cells are ignored. Logical values (TRUE/FALSE) are ignored.
bins_arrayRequiredThe upper boundaries of each bin, in ascending order. FREQUENCY counts values up to and including each boundary. Providing five bin boundaries returns six counts (including the overflow bucket above the last boundary).
FREQUENCY returns n+1 values: If bins_array contains 5 values, FREQUENCY returns 6 counts. The extra count at the end holds everything above the last bin boundary. In Excel 2019 and earlier, select exactly n+1 rows before pressing Ctrl+Shift+Enter — selecting too few rows truncates the output and the overflow count disappears.

How Does FREQUENCY Handle Bin Boundaries?

Each bin in FREQUENCY captures values strictly greater than the previous boundary and less than or equal to the current boundary. This is sometimes written as (prev, current]. A value that exactly equals a boundary falls into that bin, not the next one. Consequently, if your bin boundaries are 10, 20, 30 and a value is exactly 20, it is counted in the second bin (the 11–20 range), not the third.

Bin boundaryCounts values that areNotation
First boundary = 10≤ 10 (from −∞)(−∞, 10]
Second boundary = 20> 10 and ≤ 20(10, 20]
Third boundary = 30> 20 and ≤ 30(20, 30]
Overflow (no boundary)> 30 (up to +∞)(30, +∞)

Examples 1–4: Core FREQUENCY Patterns

1
Basic frequency table — count values per bin

The fundamental use is counting how many data values fall into each interval. Define the bin upper boundaries in a column, then enter FREQUENCY referencing the data and the boundaries. The result is a column of counts — one per bin plus the overflow row. This table is the raw material for a histogram chart.

Bin upper (D)
Label (E)
Count (F)
Bar
100
0–100
14
14
200
101–200
31
31
300
201–300
28
28
400
301–400
19
19
Overflow
>400
8
8
Data in A2:A101 (100 values). Bin boundaries in D2:D5 = {100, 200, 300, 400}. Excel 365 — enter in F2 and spill automatically (5 rows: 4 bins + 1 overflow): =FREQUENCY(A2:A101, D2:D5) → Spills {14; 31; 28; 19; 8} into F2:F6 F6 = 8 = overflow count (values above 400) Excel 2019 and earlier — array entry required: Select F2:F6 (5 rows = 4 bins + 1 overflow), type formula, Ctrl+Shift+Enter. {=FREQUENCY(A2:A101, D2:D5)} Verify: the sum of all counts must equal the total data count. If this formula returns FALSE, a value was accidentally excluded. =SUM(=FREQUENCY(A2:A101, D2:D5)) = COUNT(A2:A101) → TRUE (100 = 14+31+28+19+8)
2
Histogram chart — visualise the distribution from FREQUENCY output

A histogram is a bar chart where bars are adjacent and represent bin counts. Excel’s built-in Histogram chart type (Insert → Charts → Histogram) calculates bins automatically but gives limited control. Building the chart manually from FREQUENCY output gives you full control over bin boundaries, labels, and formatting. The key step is setting gap width to zero so the bars touch.

Layout for a histogram from FREQUENCY output: Column D = bin labels (text): "0-100", "101-200", "201-300", "301-400", ">400" Column F = FREQUENCY counts: {14, 31, 28, 19, 8} Step 1: Select D2:D6 and F2:F6 (hold Ctrl to select two non-adjacent columns). Step 2: Insert → Charts → Column Chart → Clustered Column. Step 3: Right-click a bar → Format Data Series → Gap Width → set to 0%. This removes the gaps and makes bars touch — the histogram shape. Step 4: Add axis title (bin ranges) and data labels (counts) for clarity. Excel built-in Histogram (Insert → Charts → Histogram): Select the raw data column (A2:A101), not the FREQUENCY table. Excel calculates bins automatically. Adjust bins via Format Axis → Bins. Advantage: auto-updates when data changes. Limitation: less control over bin boundaries than the manual approach.
Use the FREQUENCY-based manual approach when you need specific bin boundaries, custom labels, or want the chart to update dynamically as you adjust the bins in your table. Use the built-in Histogram when speed matters and auto-bin is acceptable.
3
Relative frequency and cumulative percentage

Raw counts from FREQUENCY tell you how many values are in each bin. Relative frequency converts those counts to percentages of the total. A cumulative percentage shows the proportion of all values falling at or below each bin. These two derived columns transform a basic count table into a complete distribution summary suitable for reporting.

Bin
Count (F)
Relative %
Cumulative %
Interpretation
0–100
14
14%
14%
14% scored 100 or below
101–200
31
31%
45%
45% scored 200 or below
201–300
28
28%
73%
73% scored 300 or below
F2:F6 = FREQUENCY counts. Total in F7 = SUM(F2:F6) = 100. Relative frequency — count / total (G2, copy down to G6): Format column G as Percentage with 0 decimal places. F2 / $F$7 → 14% for the first bin (14/100) Cumulative frequency — running total of counts (H2, copy down to H6): H2 starts at F2. H3 = H2 + F3. H4 = H3 + F4, etc. =SUM($F$2:F2) / $F$7 → The locked $F$2 expands as the formula copies down, accumulating totals. Verify: H6 (final cumulative %) must equal exactly 100%. If it is less, the overflow row was excluded from the denominator. =SUM($F$2:F6) / $F$7 → 100% (all rows included)
4
Dynamic bins — auto-generate bin boundaries from MIN, MAX, and step size

Hard-coded bin boundaries break when data changes range. A dynamic approach generates bin boundaries automatically from the minimum and maximum of the data, divided by a step size you control. This is specifically useful when the data range changes regularly — for example, monthly sales reports where the maximum order value varies each month.

A2:A200 = data values (changes monthly). D1 = step size (e.g. 50 — user-controlled input cell). Auto-calculate the number of bins needed: CEILING rounds up to the nearest step, then divides by step size. =CEILING(MAX(A2:A200), $D$1) → Rounds the max up to the next multiple of step size Generate bin boundaries dynamically — Excel 365 with SEQUENCE: SEQUENCE(n) creates {1,2,3,...,n} — multiply by step to get boundaries. D2 = step size. D3 = first boundary = CEILING(MIN,step). This generates bin boundaries from first to max in one spilling formula. =SEQUENCE( CEILING(MAX($A$2:$A$200), $D$1) / $D$1, 1, $D$1, $D$1 ) → Spills {50; 100; 150; 200; ...} for step = 50 Automatically extends if max increases next month Pass the dynamic bins to FREQUENCY: E2 = the SEQUENCE result (spilled bins). F2 = FREQUENCY output. FREQUENCY spills the same number of rows as E2 plus one overflow row. =FREQUENCY($A$2:$A$200, E2#) → # references the entire spilled range from E2. Updates when data changes.

Examples 5–8: Applied Frequency Analysis

Grading, Quality Control, and Comparison

5
Grade banding — count students in each score range

FREQUENCY is the natural tool for assigning groups of values to score bands. For a class of students, bin boundaries at 39, 49, 59, 69, 79, 89 and 100 divide scores into F, D, C, B, A, A+ ranges. Each bin count tells you how many students fall in that grade category. The table updates instantly when any score changes.

Upper bound (D)
Grade (E)
Count (F)
% of class
39
F (0–39)
3
6%
49
D (40–49)
7
14%
59
C (50–59)
12
24%
69
B (60–69)
15
30%
79
A (70–79)
9
18%
100
A+ (80–100)
4
8%
Student scores in A2:A51 (50 students). Bin boundaries in D2:D7 = {39, 49, 59, 69, 79, 100}. Note: 100 is included as a boundary to capture perfect scores. The overflow row (above 100) should be zero if all scores are ≤ 100. Enter in F2 and spill (Excel 365): =FREQUENCY(A2:A51, D2:D7) → Returns {3; 7; 12; 15; 9; 4; 0} 7 rows = 6 bin boundaries + 1 overflow (0 students scored above 100) Pass rate — proportion of students who scored 50 or above (grades C and above): Sum bins from grade C upward — F4:F7 (C through A+) / total. =SUM(F4:F7) / COUNT(A2:A51) → 80% pass rate (40 of 50 students scored 50 or above) Count students in a specific grade programmatically — FREQUENCY for grade B: FREQUENCY with a single boundary counts values in one specific range. Counts values >60 and ≤70 without building a full table. =FREQUENCY(A2:A51, 70) - =FREQUENCY(A2:A51, 60) → Count in range (60, 70] = grade B students only
6
Quality control — defect rate by tolerance band

In manufacturing quality control, measurements are compared to specification limits. FREQUENCY counts how many items fall within tolerance, below the lower limit, and above the upper limit. This three-zone breakdown gives a fast summary of defect rates. Additionally, pairing FREQUENCY with conditional formatting highlights which tolerance bands are out of spec.

A2:A300 = component measurements (e.g. diameter in mm). Specification: target = 50mm. LSL = 48mm. USL = 52mm. Three-zone tolerance analysis: Bin boundaries = {48, 52} define three zones: Zone 1: ≤48 (below lower spec limit — undersize defects) Zone 2: >48 and ≤52 (within tolerance — acceptable) Zone 3: >52 (above upper spec limit — oversize defects) Enter in D2 (Excel 365, spills 3 rows = 2 bins + 1 overflow): =FREQUENCY(A2:A300, {48, 52}) → D2: undersize count, D3: in-spec count, D4: oversize count Defect rate (total out-of-spec): D2 = undersize count, D4 = oversize count, D5 = total n. (D2 + D4) / D5 → e.g. 0.043 = 4.3% defect rate Yield (in-spec rate): D3 = in-spec count. D3 / D5 → 0.957 = 95.7% yield (formatted as Percentage) Process capability Cp (simplified): Compare the spec range to the data spread (STDEV.P). Cp = (USL - LSL) / (6 * STDEV.P). (52 - 48) / (6 * STDEV.P(A2:A300)) → Cp index (>1.33 = capable process)
7
Comparing two distributions — side-by-side frequency tables

FREQUENCY makes it straightforward to compare two datasets using identical bin boundaries. Running FREQUENCY on each dataset with the same bins_array produces two count columns that share the same scale. The comparison reveals whether the two distributions have similar shapes, whether one is shifted higher, or whether one has heavier tails.

A2:A100 = Group A scores. B2:B100 = Group B scores. Shared bin boundaries in D2:D5 = {25, 50, 75, 100}. Group A frequency (F2, Excel 365): =FREQUENCY(A2:A100, $D$2:$D$5) → {8; 24; 41; 22; 5} (counts for Group A) Group B frequency (G2, Excel 365): =FREQUENCY(B2:B100, $D$2:$D$5) → {3; 18; 38; 32; 9} (counts for Group B) Group B is shifted higher — more values in 76–100 range Relative frequency comparison — convert both to percentages for fair comparison. Group A % (H2): =F2/SUM(F2:F6) Group B % (I2): =G2/SUM(G2:G6) Copy both down to rows 6. Difference column (J2) — Group B % minus Group A % per bin: Positive = Group B has more values in this range. Negative = Group A has more values in this range. I2 - H2 → +0.04 means Group B has 4 percentage points more in this bin than Group A
8
Unique value count — FREQUENCY trick to count distinct values

FREQUENCY has a well-known secondary use: counting the number of distinct (unique) values in a dataset. When you pass data_array as both arguments, FREQUENCY returns 1 for each first occurrence and 0 for every duplicate. Summing a comparison against zero gives a count of distinct values. This works across all Excel versions and is faster than COUNTIF-based alternatives on large datasets.

A2:A100 = data containing duplicate values (e.g. customer IDs, product codes). Goal: count how many distinct values exist in the column. Classic FREQUENCY distinct-count trick: FREQUENCY(data, data) returns 1 for each unique first occurrence, 0 for repeats. Summing >0 counts only the unique values. =SUM(--(=FREQUENCY(A2:A100, A2:A100)>0)) → Count of distinct numeric values in A2:A100 Excel 2019 and earlier — array entry required (Ctrl+Shift+Enter): {=SUM(--(FREQUENCY(A2:A100,A2:A100)>0))} Limitation: FREQUENCY only works with numbers. For text values, use SUMPRODUCT with COUNTIF instead: =SUMPRODUCT(1/COUNTIF(A2:A100,A2:A100)) counts distinct text and numbers. Count distinct values within a condition — e.g. distinct customers in "North": Combine FREQUENCY with IF to filter before counting. =SUM(--(=FREQUENCY( IF(B2:B100="North", A2:A100), IF(B2:B100="North", A2:A100) )>0)) → Count of distinct customer IDs in the North region only
Excel 365 modern alternative: In Excel 365, use =ROWS(UNIQUE(A2:A100)) to count distinct values. This is simpler, handles text, and does not require the FREQUENCY trick. However, the FREQUENCY approach works in all Excel versions without any special function availability.

Common Issues and How to Fix Them

FREQUENCY only returns one value instead of the full array

In Excel 2019 and earlier, FREQUENCY must be entered as an array formula. Select the output range first — exactly n+1 rows for n bin boundaries — then type the FREQUENCY formula and press Ctrl+Shift+Enter. If you press Enter normally, only the first count appears. In Excel 365 and 2021, FREQUENCY spills automatically from a single cell without any special entry. If you accidentally type a normal formula in Excel 365 and it still only shows one value, check whether Automatic Calculation is turned off in Formulas → Calculation Options.

The counts do not sum to the total data count

If SUM(FREQUENCY results) is less than COUNT(data), some values were excluded. FREQUENCY ignores text and empty cells, so check the data column for accidental text entries that look like numbers — for example, numbers stored as text after importing from a CSV. Use =ISNUMBER(A2) to check individual cells. Additionally, make sure the output range is long enough to include the overflow row. Selecting one row short in Excel 2019 silently drops the overflow count.

Bins are not sorted in ascending order

FREQUENCY requires the bins_array to be sorted from smallest to largest. Unsorted bins produce incorrect counts — values may be allocated to the wrong bin without any error message. Always sort the bin boundaries before passing them to FREQUENCY. In Excel 365, wrap the bins in SORT: =FREQUENCY(A2:A100, SORT(D2:D5)) to sort automatically before the count.

Do not delete cells in the middle of a FREQUENCY spill range: In Excel 365, FREQUENCY spills into multiple adjacent cells. Deleting or editing any cell inside the spill range — except the top-left cell — breaks the array and produces a #SPILL! error. To resize the output, edit only the formula in the top-left cell. In Excel 2019 and earlier, the entire Ctrl+Shift+Enter range is locked as a block — you must delete and re-enter the whole formula to change the bin count.

Frequently Asked Questions

  • How does the FREQUENCY function work in Excel?+
    FREQUENCY takes two arguments: a data range and a bins range. It counts how many values from the data fall into each bin interval. Each bin captures values greater than the previous boundary up to and including the current boundary. The function always returns one more value than the number of bin boundaries — the extra value counts everything above the last bin. In Excel 365, FREQUENCY spills automatically. In Excel 2019 and earlier, select the output range (n+1 rows), type the formula, and confirm with Ctrl+Shift+Enter.
  • Why does FREQUENCY return one more value than the number of bins?+
    FREQUENCY automatically adds an overflow bucket above the last bin boundary. This captures any values that exceed the largest bin. For example, if your bins are {100, 200, 300}, FREQUENCY returns four counts: values ≤100, values from 101–200, values from 201–300, and values above 300. This overflow count is often zero in practice — but it is always present in the output. Always include this extra row in your output range, especially in Excel 2019 where forgetting it silently drops data from the last bin.
  • How do I use FREQUENCY to count unique values?+
    Pass the same range as both data_array and bins_array: =SUM(--(FREQUENCY(A2:A100, A2:A100)>0)). When the same array is used for both arguments, FREQUENCY returns 1 for each unique first occurrence of a value and 0 for every duplicate. Summing the results of the >0 comparison gives the count of distinct values. This technique only works for numeric data. In Excel 365, =ROWS(UNIQUE(A2:A100)) is simpler and works for text as well. In Excel 2019 and earlier, the FREQUENCY trick is the most efficient formula-based approach.

More Questions About FREQUENCY

  • What is the difference between FREQUENCY and COUNTIF for binning?+
    Both count values in ranges, but they work differently. FREQUENCY processes the entire dataset and all bins in a single call, returning all counts at once. COUNTIF counts one range at a time — you need a separate formula for each bin. For a few bins, COUNTIF is simpler: =COUNTIFS(A:A,">"&D2, A:A,"<="&D3). For many bins, FREQUENCY is faster and less error-prone because all intervals share the same data reference and cannot accidentally differ. Additionally, FREQUENCY has the unique value counting trick that COUNTIF cannot replicate as efficiently.
  • Does FREQUENCY work with text values?+
    No. FREQUENCY only counts numeric values. Text strings, blank cells, and logical values (TRUE/FALSE) are ignored entirely. If your data column contains numbers stored as text — a common issue after CSV imports — those cells are also excluded, which can cause the FREQUENCY totals to fall short of the actual row count. Use =ISNUMBER(A2) to check individual cells, and =VALUE(A2) or the Text to Columns wizard to convert text-stored numbers to genuine numeric values before running FREQUENCY.
  • Can I create a histogram without the FREQUENCY function?+
    Yes — Excel offers two alternatives. First, the built-in Histogram chart type (Insert → Charts → Histogram) calculates bin counts automatically from your raw data without any formula. It is the fastest approach for exploratory analysis. Second, the Data Analysis Toolpak (Developer → Data Analysis → Histogram) generates a frequency table and chart in one step. However, both alternatives produce static output that does not automatically update when data changes. FREQUENCY-based tables update in real time, which is why formula-driven histograms are preferred for reporting dashboards and automated workbooks.