Excel Stats Formulas: Quick Guide to Key Functions
In this article
Excel statistical formulas let you analyze data quickly—calculate averages, find trends, assess variability, and more—using built-in functions. No add-ins or special setup required; just enter data in a column or row and use the right function with correct syntax. This guide covers the most essential statistical functions with clear, actionable steps.
What You'll Need
- Microsoft Excel (any modern version: Excel 2010, 2013, 2016, 2019, 2021, or Microsoft 365)
- A worksheet with numeric data in a contiguous range (e.g., A2:A101)
- Basic understanding of cell references (e.g., A1, B2:B50)
Step-by-Step
- Open Excel and create or open a workbook with your dataset. Ensure numbers are in one continuous column or row (e.g., sales figures in A2:A101, with no blank cells or text in between).
- Click the cell where you want the result to appear (e.g., C2 for the mean).
- For the arithmetic mean (average), type
=AVERAGE(A2:A101)and press Enter. This ignores text and blank cells automatically. - For the median (middle value), type
=MEDIAN(A2:A101)and press Enter. Useful when outliers skew the mean. - For the mode (most frequent value), use
=MODE.SNGL(A2:A101)for a single mode, or=MODE.MULT(A2:A101)for multiple modes (entered as an array formula with Ctrl+Shift+Enter in older Excel versions). - To measure spread, calculate standard deviation with
=STDEV.S(A2:A101)for a sample or=STDEV.P(A2:A101)for a full population. Use .S for typical survey or sample data; .P only if analyzing every possible data point. - For variance (square of standard deviation), use
=VAR.S(A2:A101)(sample) or=VAR.P(A2:A101)(population). - To find the minimum and maximum values, use
=MIN(A2:A101)and=MAX(A2:A101)respectively. - For count of numeric entries only, use
=COUNT(A2:A101). For all non-empty cells (including text), use=COUNTA(A2:A101). - To calculate the range (max − min), combine functions:
=MAX(A2:A101) - MIN(A2:A101).
Common Mistakes
- Using
=AVERAGEIFor=AVERAGEIFSwithout quoting text criteria (e.g.,=AVERAGEIF(B2:B100, ">100", A2:A100)is correct;=AVERAGEIF(B2:B100, >100, A2:A100)throws #NAME? error). - Confusing sample and population functions: using
STDEV.Pon sample data inflates confidence incorrectly; always verify if your data represents a sample or entire population. - Including headers in the range (e.g., A1:A101 when A1 is "Sales")—this returns #VALUE! or distorts results. Start ranges at the first numeric value (A2).
- Forgetting that
MODE.SNGLreturns #N/A if no value repeats;MODE.MULTreturns an array and requires selecting multiple cells first. - Mixing up
COUNTandCOUNTA—COUNTignores text and blanks, so if your column has labels and numbers, it undercounts.
Tips
- Use named ranges for clarity: select A2:A101, type "SalesData" in the Name Box (left of formula bar), then use
=AVERAGE(SalesData). - Combine functions for deeper insight:
=AVERAGEIF(A2:A101, ">0")gives the mean of only positive values. - Check for hidden rows/columns: functions like
SUBTOTALwith function_num 101 (e.g.,=SUBTOTAL(101,A2:A101)) ignore hidden cells, unlikeAVERAGE. - Use Excel's Function Arguments dialog: click
fxnext to the formula bar, select a function (e.g., STDEV.S), and Excel walks you through required arguments. - Drag fill handles to apply formulas to adjacent cells—but watch relative references (A2:A101) shift; lock with $ (e.g., $A$2:$A$101) for fixed ranges.
- For large datasets, press F9 while selecting a formula part to preview its result—helps debug complex formulas like
=IF(AVERAGE(A2:A101)>50,"High","Low").
Troubleshooting
- #NAME? error: Check for typos in function names (e.g., "AVERGAE") or missing quotes around text criteria. Ensure you're not using non-English function names in an English Excel version.
- #DIVIDE/0!: Occurs in functions like
MODE.SNGLwhen no value repeats, or if the range is empty. Add a check:=IF(COUNT(A2:A101)>0,MODE.SNGL(A2:A101),"No mode"). - #VALUE! error: Usually from including non-numeric text in numeric ranges. Filter data to remove or replace non-numbers, or use
=AVERAGEIF(A2:A101,">0")to skip zeros and text. - Unexpected result: Verify your range includes only intended cells. A stray space or hidden character (e.g., non-breaking space) can cause issues—use
=TRIM(A2)on source data if needed. - Formula not updating: Check if Calculation Options is set to Automatic (Formulas tab > Calculation Options > Automatic). Manual mode requires pressing F9 to refresh.
- Array formula errors with MODE.MULT: In Excel 2019 or earlier, after typing
=MODE.MULT(A2:A101), select a vertical range of cells, press F2, then Ctrl+Shift+Enter. Newer Excel (Microsoft 365) handles dynamic arrays automatically.
Frequently Asked Questions
What's the difference between STDEV.S and STDEV.P?
STDEV.S estimates standard deviation for a sample of a population, using n−1 in the denominator (Bessel's correction). STDEV.P calculates for an entire population, using n. Use STDEV.S unless your data includes every possible observation (e.g., all sales for a year vs. 10 random days of sales).Can I calculate standard deviation for non-contiguous cells?
Yes. List them separated by commas:=STDEV.S(A2,A5,A10,B3). Or use multiple ranges with union syntax: =STDEV.S((A2:A10,C2:C10)).
How do I find the median with criteria?
Use=MEDIAN(IF(logical_test,range)) as an array formula. Example: =MEDIAN(IF(A2:A100="East",B2:B100)) (press Ctrl+Shift+Enter in older Excel). In Excel 365, =MEDIAN(FILTER(B2:B100,A2:A100="East")) works directly.
Why does COUNT return fewer numbers than expected?
COUNT only counts cells with numbers. If your column has text (e.g., "N/A"), blanks, or errors, they're excluded. Use COUNTA for all non-empty cells, or COUNTBLANK for empty ones.Is there a built-in function for standard error?
No—standard error = STDEV.S(range)/SQRT(COUNT(range)). Type=STDEV.S(A2:A101)/SQRT(COUNT(A2:A101)) to compute it.
How do I handle #N/A in my data?
Wrap functions in IFERROR or IFNA. Example:=IFERROR(AVERAGE(A2:A101),0) returns 0 if any error occurs. For specific #N/A from missing data, use =AVERAGEIF(A2:A101,"<>#N/A")—though #N/A is text, so better to clean data first with Filter > Text Filters > Does Not Contain #N/A.