The average spreadsheet formula is =AVERAGE(), which returns the arithmetic mean of a set of numbers. For example, =AVERAGE(A1:A10) calculates the mean of the values in cells A1 through A10.
What the AVERAGE Function Does
The AVERAGE function in Excel (and Google Sheets) adds up all the numeric values in the given range or list and divides by the count of those numbers. It ignores empty cells, text, and logical values (TRUE/FALSE) unless you include them directly as arguments. For instance, if A1:A5 contains 10, 20, 30, 40, and “N/A”, =AVERAGE(A1:A5) returns 25 (sum 100 divided by 4 numbers), because the text is ignored.
The function’s syntax is straightforward: =AVERAGE(number1, [number2], ...). You can reference individual cells, ranges, or even typed numbers. In Excel for Microsoft 365, you can also use =AVERAGE(A1:A10, C1:C10) to average across multiple ranges.
How to Use AVERAGE in Excel
To use the function in Excel for Microsoft 365 on Windows:
- Click the cell where you want the result.
- Type
=AVERAGE(. - Select the range of cells (e.g.,
A1:A10) or type it manually. - Close the parenthesis and press Enter.
Alternatively, you can go to the Formulas tab, click AutoSum (the Σ icon), and choose Average from the dropdown. On a Mac, the steps are identical; the keyboard shortcut for AutoSum is Shift+Command+T (Windows: Alt+= then press Enter).
For a quick average without a formula, select the cells and look at the status bar at the bottom right—Excel shows the average there by default (right-click the status bar to customize).
Common Variations: AVERAGEIF and AVERAGEIFS
Sometimes you need the average of only certain values. That’s where AVERAGEIF and AVERAGEIFS come in.
=AVERAGEIF(range, criteria, [average_range])averages cells that meet one condition. Example: with sales in B2:B20 and region in A2:A20,=AVERAGEIF(A2:A20, "West", B2:B20)returns the average sales for the West region.=AVERAGEIFS(average_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)averages cells that meet multiple conditions. Example:=AVERAGEIFS(B2:B20, A2:A20, "West", C2:C20, ">100")averages West sales over 100.
These functions ignore text and empty cells in the average range, but if the criteria range contains text, you must use quotes around the text (as shown).
How to Choose Between AVERAGE, MEDIAN, and MODE
The arithmetic mean is not always the best measure of central tendency. If your data has outliers (extreme values), the mean can be misleading. For example, if five salaries are 30k, 35k, 40k, 45k, and 200k, the average is 70k, but most people earn around 40k. In such cases, the median (the middle value) is more representative.
Use =MEDIAN() for the middle value, and =MODE.SNGL() for the most frequently occurring value. A general rule: if your data is roughly symmetric without outliers, use AVERAGE; if it’s skewed, use MEDIAN; if you need the most common value, use MODE.
Common Problems and Errors with AVERAGE
Here are typical issues users face:
- #DIV/0! error: Occurs when the range contains no numbers. For example,
=AVERAGE(A1:A5)where all cells are empty or text. Fix by ensuring at least one numeric value, or use=IFERROR(AVERAGE(A1:A5), 0)to return 0 instead. - Including hidden or filtered rows: AVERAGE ignores hidden rows only if you use the SUBTOTAL function with function_num 1 (e.g.,
=SUBTOTAL(1, A1:A10)). Regular AVERAGE includes hidden rows. - Blank cells vs. zeros: AVERAGE ignores blank cells but includes zeros. If you want to include blanks as zeros, you need to fill them or use a different formula.
- Text numbers: Numbers stored as text are ignored. To convert, use the VALUE function or the Text to Columns wizard.
AVERAGE in Google Sheets and Other Spreadsheets
Google Sheets uses the same AVERAGE function with identical syntax. The main difference is that Google Sheets automatically includes numbers stored as text if they are entered as numbers, but it also ignores text in ranges. For conditional averages, both AVERAGEIF and AVERAGEIFS work the same way.
In LibreOffice Calc and Apple Numbers, the function is also =AVERAGE(), but the menu paths differ slightly. In Excel for the web, the function works exactly as in the desktop version, but the AutoSum button is under the Home tab.
Practical Examples and Tips
Let’s walk through a real scenario: you have test scores in B2:B11 (values: 85, 92, 78, 88, 95, 67, 91, 74, 82, 89). To find the class average, enter =AVERAGE(B2:B11) in any cell. The result is 84.1 (sum 841 divided by 10).
For a weighted average (e.g., grades where homework is 30% and exams are 70%), you would use =SUMPRODUCT() instead: with weights in C2:C3 and scores in B2:B3, =SUMPRODUCT(B2:B3, C2:C3)/SUM(C2:C3) gives the correct weighted mean.
Another tip: to average only the top 5 values in a range, use =AVERAGE(LARGE(A1:A100, {1,2,3,4,5})) (array formula in older Excel, but works in Excel 365).
Frequently Asked Questions
How do I average only non-zero cells?
Use =AVERAGEIF(A1:A10, "<>0"). This averages all cells that are not equal to zero, ignoring blanks and text.
Why does my AVERAGE formula return #DIV/0!?
This error appears when the range has no numeric values. For example, if all cells are empty or contain text, AVERAGE has nothing to divide. Check that your range includes at least one number, or use IFERROR to handle it gracefully.
Can I average cells with errors like #N/A?
No, AVERAGE will return the error if any cell in the range contains an error. To ignore errors, use =AGGREGATE(1, 6, A1:A10) (where 6 means ignore error values) in Excel 2010 and later, or =AVERAGE(IFERROR(A1:A10, "")) as an array formula (Ctrl+Shift+Enter in older Excel).
What is the difference between AVERAGE and AVERAGEA?
AVERAGE ignores text and logical values, while AVERAGEA includes text (counted as 0) and logical TRUE (counted as 1, FALSE as 0). For example, AVERAGEA(A1:A3) with values 5, “text”, TRUE returns 2 (5+0+1 divided by 3).
How do I calculate a moving average in Excel?
Use the AVERAGE function with a sliding range. For a 3-month moving average, in cell C3 enter =AVERAGE(B2:B4) and drag down. Or use the Data Analysis Toolpak (Data > Data Analysis > Moving Average) for a more advanced setup.
Does AVERAGE include hidden rows?
Yes, the standard AVERAGE function includes hidden rows. If you want to exclude hidden rows, use =SUBTOTAL(1, A1:A10) or =AGGREGATE(1, 5, A1:A10) (option 5 ignores hidden rows).
Related
- Formula for Concatenate in Excel & Google Sheets
- Software Entry Data Backup: How It Works & Best Practices
- 100 Computer Shortcut Keys: Windows & Mac Guide
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Excel Sum by Date: Formulas for Daily and Monthly TotalsTo sum values for a date in Excel, use SUMIF with the date column as the criteria range…
- How to Set Up VLOOKUP in Excel: Step-by-StepVLOOKUP is Excel’s classic function for looking up a value in the first column of a table and…
- Days Left in Excel: Calculate Workdays and Calendar DaysTo calculate days left in Excel, subtract today’s date from the deadline: if the deadline is in A2,…
- Excel Table Header Formula: What Works and What Doesn’tExcel table headers are column labels, not the place to put a formula you expect to calculate or…
- AVERAGEIF Across Sheets in Excel: Formulas & ExamplesExcel’s AVERAGEIF function cannot directly average matching values across multiple worksheets in one formula. Assuming Jan and Feb…
- Excel Table Filter by Multiple Colors: What WorksIn Excel for Microsoft 365 on Windows, a table’s color filter can show rows for one selected fill…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.