FREQUENCY Function in Excel
The FREQUENCY function counts values within specific ranges and returns a vertical array of frequencies. Master distribution analysis with examples.
=FREQUENCY(data_array, bins_array)Quick Answer
FREQUENCY function FREQUENCY function calculates how often values occur within specified ranges, returning a vertical array of frequencies. Use `=FREQUENCY(data_array, bins_array)` to count values falling into each bin interval. Perfect for creating histograms and analyzing data distributions across grade ranges, price tiers, or age groups.
=FREQUENCY(data_array, bins_array)Practical Examples
Basic Grade Distribution
Categorize student test scores into grade ranges (F, D, C, B, A)
Sales Analysis by Price Range
Group 500 products into price tiers for marketing analysis
Age Group Demographics with Array Constants
Analyze customer database by age brackets using embedded bins
Response Time Analysis with Percentages
Convert customer service response times to percentage distribution
Dynamic Array with Spill (Excel 365)
Modern FREQUENCY usage with automatic spill behavior
Common Errors and Solutions
Formula returns #VALUE! error
The data_array or bins_array contains text values, or the bins are not sorted in ascending order
**Step-by-step fix:** 1. Verify all data is numeric using ISNUMBER function 2. Remove or exclude text entries from your ranges 3. Sort bins_array in ascending order (10, 20, 30 not 20, 10, 30) 4. Use VALUE() function to convert text numbers to actual numbers 5. Apply IFERROR wrapper for graceful error handling
To prevent this error: 1) Use data validation to restrict input to numbers only, 2) Apply =SORT(BinRange) to ensure bins are always ordered, 3) Check for hidden characters or spaces in numeric cells
Example:
Array formula cannot spill to required range
Output cells are not empty, merged cells exist in spill range, or protected cells block the spill path
**Immediate fixes:** 1. Clear all cells where the array needs to spill (check for hidden content) 2. Unmerge any merged cells in the spill range 3. Move formula to area with empty cells below 4. Unprotect cells in the spill path if worksheet is protected **How to identify blocked cells:** Click the #SPILL! error and Excel highlights the blocking cells in orange. The blue border shows where FREQUENCY needs to spill.
Before entering FREQUENCY, ensure empty space equal to (bins + 1) cells below your formula location
Example:
Formula returns #N/A in some cells
In legacy Excel (2019 and earlier), you didn't select enough cells for output array. FREQUENCY needs bins + 1 cells but fewer were selected.
**Complete fix procedure:** 1. Delete the existing formula completely 2. Count your bins (e.g., 5 bins) 3. Select range with bins + 1 cells (e.g., 6 cells: E2:E7) 4. Type the formula: =FREQUENCY(B2:B50, D2:D6) 5. Press Ctrl+Shift+Enter (not just Enter) 6. Formula appears with curly braces: {=FREQUENCY(B2:B50, D2:D6)} **The golden rule:** Always select ONE MORE cell than the number of bins
Example:
Numbers don't match expected distribution
Bins not sorted in ascending order, misunderstanding of bin boundaries (inclusive vs exclusive), or duplicate values in bins_array
**Understanding bin logic:** - First bin: counts values ≤ first bin value - Middle bins: count values > previous bin AND ≤ current bin - Last category (extra cell): counts values > last bin value **Example:** Bins [60, 70, 80, 90] create these ranges: - Cell 1: values ≤60 - Cell 2: values 61-70 (>60 and ≤70) - Cell 3: values 71-80 (>70 and ≤80) - Cell 4: values 81-90 (>80 and ≤90) - Cell 5: values >90 **Fixes:** 1. Sort bins in ascending order: =SORT(D2:D6) 2. Verify bin boundaries match your intention 3. Check data range includes all values you want to analyze 4. Remove any duplicate values from bins_array 5. Use helper column with COUNTIFS to verify one bin manually
Advanced Tips and Best Practices
Always Sort Your Bins in Ascending Order
FREQUENCY requires bins to be sorted from smallest to largest for accurate results. Unsorted bins produce incorrect or unpredictable distributions. Before using FREQUENCY, verify your bins increase sequentially: 10, 20, 30, 40, not 20, 10, 40, 30. Use =SORT(BinRange) to automatically sort bins, or manually verify the sequence. This single step prevents 35% of FREQUENCY errors.
Create Dynamic Bins with SEQUENCE
In Excel 365, generate bins automatically using the SEQUENCE function for evenly-spaced intervals. Instead of manually typing bins, use: `=FREQUENCY(Data, SEQUENCE(10, 1, 10, 10))` This creates bins at 10, 20, 30...100 automatically. The syntax is SEQUENCE(rows, columns, start, step). Benefits: eliminates manual bin entry, easy to adjust ranges, consistent spacing guaranteed. Advanced: combine with MIN/MAX for data-driven bin ranges: `=FREQUENCY(Data, SEQUENCE(10, 1, MIN(Data), (MAX(Data)-MIN(Data))/10))`
Convert to Percentages for Better Comparisons
Divide FREQUENCY results by total count to get percentage distributions instead of raw counts: `=FREQUENCY(Data, Bins) / COUNT(Data)` Then format cells as percentages. This makes comparing datasets of different sizes much easier. For example, comparing test results from a class of 20 vs. a class of 30 is clearer with percentages (30% got A's) rather than raw counts (6 students vs. 9 students). Percentage distributions also create clearer, more professional visualizations in charts.
Remember: FREQUENCY Returns n+1 Values for n Bins
This is the most commonly forgotten rule. FREQUENCY always returns one more value than the number of bins because the last cell counts all values ABOVE your highest bin. If you have 5 bins, you need 6 output cells. The extra cell captures outliers and values exceeding your maximum bin. **Common mistake:** Selecting only 5 cells for 5 bins causes #N/A errors in legacy Excel. **Correct approach:** 5 bins = 6 output cells. Always add 1 to your bin count when selecting the output range.
Combine with Charts for Professional Histograms
Use FREQUENCY output as the data source for column charts to create custom histograms: 1. Generate frequency distribution with FREQUENCY 2. Select frequency results and corresponding bin labels 3. Insert → Charts → Clustered Column Chart 4. Format: Remove gaps between columns (Gap Width = 0%) 5. Customize axes, colors, and titles This gives you complete control over bin ranges and appearance, unlike Excel's automatic histogram chart which chooses bins for you. Professional histograms are essential for presentations and reports.
Platform Differences: Legacy vs. Dynamic Arrays
**Excel 2019 and earlier (Legacy method):** 1. Select output range (bins + 1 cells) 2. Type formula 3. Press Ctrl+Shift+Enter 4. Curly braces appear: {=FREQUENCY(...)} **Excel 365/2021 and Google Sheets (Dynamic method):** 1. Type formula in single cell 2. Press Enter 3. Results auto-spill with blue border 4. No curly braces, no pre-selection **Compatibility tip:** If sharing workbooks with users on older Excel versions, use the legacy method to ensure compatibility. Dynamic arrays won't work in Excel 2019 or earlier.
Need Help with FREQUENCY Function in Excel?
Stop struggling with formula syntax. Use AskFormulas to generate validated formulas instantly with our AI-powered tool.
Example Excel formula:
Related Formulas
Master the COUNTIF function to count cells that meet specific criteria. Learn syntax, practical examples, and error solutions for data analysis.
Master COUNTIFS to count cells with multiple criteria. Learn syntax, see real examples, and solve errors for powerful multi-condition data analysis.
The SUMPRODUCT function multiplies arrays and returns the sum of products. Perfect for weighted calculations and conditional sums.
The UNIQUE function returns unique values from a range or array, eliminating duplicates automatically. Perfect for creating distinct lists from data.