Skip to content

All-Access: every lesson, no ads. $8.25€8.25US$8.25$4.08US$4.08$2.41US$2.41₹224.91MX$74.91 a month, billed yearly. Free to start. Cancel any time

See plans
All-Access, no ads: every lesson, course and template. $8.25€8.25US$8.25$4.08US$4.08$2.41US$2.41₹224.91MX$74.91 a month. + GST at checkoutSee the plans →

Functions

How to Calculate Average in Excel: AVERAGE, AVERAGEIF

By the LogicExcel Editorial Team14 min read2,742 wordsPractice this

To calculate an average in Excel, type =AVERAGE(C2:C8) and press Enter. Excel adds the numbers in C2:C8 and divides by how many numbers there are. Blank cells and text are skipped, but a zero counts as a real value, which is the detail that changes most results.

Try this now

The AVERAGE function returns the average of a group of cells. Get the average number of electoral votes among the top 6 states in B2:B7.
ABCDEF
1StateElectoral VotesDemocratic Congressional SeatsRepublican Congressional Seats
2California55476
3Texas381325
4New York29235
5Florida291316
6Illinois20155
7Pennsylvania201010
F7fx

You are typing into F7. Refer to the cells that hold the data.

Continue the full lesson →

Ready to practice?

Apply what you just learned with interactive exercises.

Start Lesson 31

This page covers AVERAGE, how blanks and zeros are treated, AVERAGEIF and AVERAGEIFS for averages with conditions, a weighted average, and when the median is a better choice.

TL;DR

  • Use =AVERAGE(C2:C8) for a simple average of a range. Separate cells with commas to average cells that do not touch: =AVERAGE(C2,C4,C6).
  • AVERAGE ignores empty cells and text in a range, but includes zeros. A zero in the data pulls the average down; a blank does not.
  • To leave zeros out, use =AVERAGEIF(C2:C8,">0").
  • For an average with conditions, use AVERAGEIF for one condition and AVERAGEIFS for several. AVERAGEIFS puts the average range first.
  • Excel has no weighted-average function. Use =SUMPRODUCT(C2:C8,D2:D8)/SUM(C2:C8).
  • When one extreme value skews the mean, check =MEDIAN(C2:C8) next to it.

Table of Contents

The sample data used on this page

The sheet is a week of results for seven delivery drivers at two depots. Column C is deliveries completed, D is average minutes per drop and E is the customer rating. Two cells are deliberately awkward: Dev was on leave, so his deliveries and minutes are logged as 0 and his rating is blank, and Grace's rating cell holds the text "n/a" because no ratings have come in.

ABCDE
1DriverDepotDeliveriesMinutes per dropRating
2AmaraEast42114.5
3BenWest38144
4ChloeEast5194.8
5DevWest00
6ElenaEast47124.2
7FemiWest35163.6
8GraceEast4410n/a

AVERAGE syntax and arguments

=AVERAGE(number1, [number2], ...)

ArgumentRequired?What it does
number1RequiredThe first number, cell or range to average.
number2, ...OptionalMore numbers, cells or ranges. Up to 255 arguments.
The result is the sum of the numbers divided by the count of numbers. The count only includes cells that hold numbers. That one sentence explains almost every surprising average: if a cell is skipped, it is skipped from both the top and the bottom of the division.

Average examples, from a column to a conditional average

Calculate the average of one column

Click an empty cell and enter:

=AVERAGE(C2:C8)

It returns 36.714, about 36.7 deliveries per driver. Excel adds 42, 38, 51, 0, 47, 35 and 44 to get 257, then divides by 7. Dev's 0 is a number, so it counts as a seventh driver. Wrap the result in ROUND to tidy it: =ROUND(AVERAGE(D2:D8),1) returns 10.3 minutes per drop.

The quick alternative needs no formula. Select C2:C8 with the mouse and read the Average in the status bar at the bottom right of the window. Nothing is stored in a cell, so use it for a fast look only.

Average cells that are not next to each other

Separate the cells with commas. Amara, Chloe and Elena (rows 2, 4 and 6):

=AVERAGE(C2,C4,C6)

It returns 46.667, which is (42 + 51 + 47) divided by 3. A range uses a colon, so =AVERAGE(C2:C4) averages the three cells in a row, rows 2 to 4, and returns 43.667. The colon versus comma difference is the most common slip on this function.

Average only the numbers above zero

Dev's zero drags the deliveries average down, and that is not fair to anyone. AVERAGEIF can skip it:

=AVERAGEIF(C2:C8,">0")

It returns 42.833, which is 257 divided by 6. The minutes column has the same problem: =AVERAGE(D2:D8) returns 10.286, but =AVERAGEIF(D2:D8,">0") returns 12, the real average for drivers who drove. A route that took 0 minutes is not a fast route; it is a missing row.

AVERAGEIF: average with one condition

The syntax is =AVERAGEIF(range, criteria, [average_range]). The first range is tested, the last range is averaged. East depot drivers:

=AVERAGEIF(B2:B8,"East",C2:C8)

It returns 46, which is (42 + 51 + 47 + 44) divided by 4. West depot:

=AVERAGEIF(B2:B8,"West",C2:C8)

That returns 24.333 because Dev's 0 is included, which is the same trap as before. Compare the two and the West looks much slower than it is.

AVERAGEIFS: average with several conditions

The syntax is =AVERAGEIFS(average_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...). The average range comes first, as in SUMIFS. West depot drivers who made at least one delivery:

=AVERAGEIFS(C2:C8,B2:B8,"West",C2:C8,">0")

It returns 36.5, which is (38 + 35) divided by 2. The same pattern averages a different column. West drivers' ratings, excluding anyone with no deliveries:

=AVERAGEIFS(E2:E8,B2:B8,"West",C2:C8,">0")

That returns 3.8, the mean of 4 and 3.6. Minutes per drop for East drivers with 45 or more deliveries:

=AVERAGEIFS(D2:D8,B2:B8,"East",C2:C8,">=45")

That returns 10.5, from Chloe (9) and Elena (12). If no row passes every test, AVERAGEIFS returns #DIV/0!, because there is nothing to divide. Our SUMIFS guide explains the same pairs of range and test.

Handle "no matches" with IFERROR

A depot with no rows returns #DIV/0!, which looks alarming in a report:

=AVERAGEIF(B2:B8,"North",C2:C8)

Wrap it to show a calmer value:

=IFERROR(AVERAGEIF(B2:B8,"North",C2:C8),0)

That returns 0. Use a zero only if a zero is honest; text such as "no data" is often better, because a zero can feed into a later average and drag it down again.

Blanks, zeros and text in an average

A short table says what AVERAGE does with each kind of cell. "Range" means the cell is inside a reference such as E2:E8.

In the rangeAVERAGEAVERAGEA
A numberCountedCounted
ZeroCountedCounted
Empty cellSkippedSkipped
Text such as "n/a"SkippedCounted as 0
TRUE or FALSESkippedCounted as 1 or 0
On the ratings column, E5 is empty and E8 holds "n/a". =AVERAGE(E2:E8) skips both, so it divides the total of 21.1 by 5 and returns 4.22. =AVERAGEA(E2:E8) counts the "n/a" as a zero and returns 3.517, which makes Grace look like a bad driver. AVERAGE is almost always the right one for a ratings column.

The same happens when the blank is an actual 0. If Dev's rating were typed as 0, the average would be 21.1 divided by 6, which is wrong in a different way. Rule of thumb: leave a cell empty when the value is unknown, and type 0 only when zero is the real value. Division by the wrong count is the quietest error in a spreadsheet, so cross-check with =SUM(E2:E8)/COUNT(E2:E8), which gives the same 4.22 and shows the count that Excel used. =COUNT(E2:E8) returns 5. The COUNT guide goes through what counts as a number.

Whole-column references behave the same way: =AVERAGE(C:C) returns 36.714, because the heading in C1 is text and is skipped. If AVERAGE meets only text, as in =AVERAGE(A2:A8), it returns #DIV/0!, since no numbers means a count of zero.

How to calculate a weighted average in Excel

A plain average treats every row as equally important. A weighted average gives each row a weight. Minutes per drop is the right example. A driver who made 51 drops should matter more than a driver who made 35.

Excel has no WEIGHTEDAVERAGE function, but the formula is short: multiply each value by its weight, add those up, and divide by the total weight.

=SUMPRODUCT(C2:C8,D2:D8)/SUM(C2:C8)

It returns 11.739 minutes per drop. SUMPRODUCT multiplies each pair and adds the products: 42 times 11, 38 times 14, 51 times 9, 0 times 0, 47 times 12, 35 times 16 and 44 times 10 add up to 3017. Divide by the 257 total deliveries and you get 11.74. Compare the unweighted figure from earlier, 12 minutes for drivers who drove. The weighted answer is lower, because the quicker drivers did more deliveries.

Dev's row causes no trouble here, because a weight of 0 contributes nothing to the top or the bottom. That is a useful property: the weighted formula handles zero-delivery rows correctly with no filter. Use the same pattern for exam scores weighted by credit hours, prices weighted by units sold or grades weighted by percentage.

AVERAGE compared with MEDIAN and other options

FunctionWhat it returnsExample on this dataUse when
AVERAGEThe mean of the numbers=AVERAGE(C2:C8) returns 36.714Values are fairly even
MEDIANThe middle value=MEDIAN(C2:C8) returns 42One extreme value skews the mean
AVERAGEIFThe mean for rows that pass one test=AVERAGEIF(C2:C8,">0") returns 42.833One condition
AVERAGEIFSThe mean for rows that pass several tests=AVERAGEIFS(C2:C8,B2:B8,"West",C2:C8,">0") returns 36.5Two or more conditions
SUBTOTAL(101, ...)The mean of the visible rows=SUBTOTAL(101,C2:C8) returns 36.714You filter the list
The median is the number in the middle once the values are sorted. For deliveries it is 42, higher than the average of 36.714, because the one zero drags the mean down while the median barely moves. When =AVERAGE(C2:C8)-MEDIAN(C2:C8) is far from zero, the data has an outlier, and you should look at it before reporting the mean. Our SUBTOTAL guide covers 101 and the other function numbers, and the broader family of numeric helpers is in the math functions guide.

Which Excel versions have these functions

AVERAGE and MEDIAN have been in Excel from the start and work in every version, in Excel for the web and in Excel for Mac. AVERAGEIF and AVERAGEIFS arrived in Excel 2007. A workbook that must open in Excel 2003 cannot use them. Nothing about the syntax changes between Windows, Mac and the web.

Average errors and what causes them

What you seeCauseFix
#DIV/0!The range has no numbers: =AVERAGE(A2:A8) points at textPoint at the number column
#DIV/0!No row passes the test: =AVERAGEIF(B2:B8,"North",C2:C8)Check the spelling, or wrap in IFERROR
#NAME?A misspelled function, such as AVGUse AVERAGE
Average looks too lowZeros are includedUse AVERAGEIF(range,">0")
Average looks too highBlanks or text were skipped, so the count is smaller than you thinkCompare against COUNT
#VALUE!A typed argument that is text and cannot be a numberRemove it, or point at a cell
If the answer looks off, calculate =SUM(C2:C8)/COUNT(C2:C8) by hand. When the two disagree with AVERAGE, one of the cells is not what you think it is.

What learners get wrong

Between 26 September and 3 November 2026, learners made 3,500 first attempts across our AVERAGE lesson, and 72.5% were right. These counts are first checks of a screen in a page view, not people. The wrong answers on the hardest screens show three habits.

Picking the wrong cells. One screen asks for the average Republican congressional seats for California, New York and Illinois. It had 578 first attempts and 59.5% were right. The accepted answer is =AVERAGE(D2,D4,D6). Fifteen first attempts used =AVERAGE(C2,C4,C6), the right rows in the wrong column. Twelve used =AVERAGE(D2,D5,D6), a right column with one wrong row. Ten used the range =AVERAGE(D2:D7), which averages all six states instead of three. Before typing, point to each cell with a finger and say which row and which column.

A range that is one row too long, or too short. The top-4-states screen had 329 first attempts, and 63.8% were right. The accepted answer is =AVERAGE(B2:B5). The most common wrong answer, 33 times, was =AVERAGE(B2:B7), which averages every state. Another 11 used the whole column, =AVERAGE(B:B). Eight stopped a row early with =AVERAGE(B2:B4). On the screen for the top 3 states' seats, 317 first attempts were 69.7% right, and the accepted answer is =AVERAGE(D2:D4). Fifteen typed =AVERAGE(D2:D5), one row too many. To check, count the rows in the range: the last row number minus the first, plus one.

A name that is not a function, or typed numbers. Ten first attempts on the first screen were =AVG(D2,D4,D6). Excel has no AVG function, so the cell would show #NAME?. On the Texas, Florida and Pennsylvania screen, 319 first attempts were 62.1% right and the accepted answer is =AVERAGE(B3,B5,B7). Eleven typed the numbers themselves, =AVERAGE(38,29,20). That returns the right figure today, but it will not update if the data changes, and the lesson wants the cell references. Seven pointed at column A, which holds names, and =AVERAGE(A3,A5,A7) has no numbers to work with.

A worked job: a delivery driver scorecard

The depot manager wants a fair scorecard for the week. Use the driver sheet above.

  1. Set the fair denominator. Count only drivers who worked: =COUNTIF(C2:C8,">0") returns 6. Everything below uses that same group. The COUNTIF guide covers the formula.
  2. Average by depot, leaving out leave days. East: =AVERAGEIF(B2:B8,"East",C2:C8) returns 46. West needs two tests, so use =AVERAGEIFS(C2:C8,B2:B8,"West",C2:C8,">0"), which returns 36.5. East drivers completed about 9.5 more deliveries each.
  3. Use a weighted average for speed. =SUMPRODUCT(C2:C8,D2:D8)/SUM(C2:C8) returns 11.739 minutes per drop for the whole fleet.
  4. Average the ratings that exist. =AVERAGE(E2:E8) returns 4.22. Do not treat Dev's blank or Grace's "n/a" as zeros.
  5. Check for skew. =AVERAGE(C2:C8) is 36.714 and =MEDIAN(C2:C8) is 42, a gap of 5.3 that comes from Dev's zero. The scorecard should quote the 42.833 from =AVERAGEIF(C2:C8,">0") instead of the raw mean.
MeasureResult
East average deliveries46
West average deliveries (drivers who worked)36.5
Fleet minutes per drop (weighted)11.74
Average rating (ratings received)4.22
Four numbers, each with a clear denominator, which is what makes a scorecard defensible when a driver asks why their number is what it is.

Practice AVERAGE in the browser

The exercise above this article is Practice Lesson 31. Type the AVERAGE formula yourself and the lesson checks it. You can start free on the site, then a pass opens the rest. After that, move on to the SUMIF guide for conditional totals, and the MIN and MAX guide for the lowest and highest values in the same range. The functions cheat sheet lists all of them in one place.

FAQ

How do I calculate the average in Excel?

Type =AVERAGE(C2:C8) in an empty cell, with your own range, and press Enter. Excel adds the numbers and divides by how many there are. For a quick look without a formula, select the cells and read the Average in the status bar.

Does AVERAGE include zeros in Excel?

Yes. A zero is a number, so it counts in both the total and the count, and pulls the average down. Empty cells and text are skipped instead. To leave zeros out, use =AVERAGEIF(C2:C8,">0").

How do I average only cells that meet a condition?

Use AVERAGEIF for one condition, such as =AVERAGEIF(B2:B8,"East",C2:C8), and AVERAGEIFS for several. AVERAGEIFS puts the range to average first: =AVERAGEIFS(C2:C8,B2:B8,"West",C2:C8,">0"). If no rows pass, both return #DIV/0!.

How do I calculate a weighted average in Excel?

Use =SUMPRODUCT(values, weights)/SUM(weights). In the sample data, =SUMPRODUCT(C2:C8,D2:D8)/SUM(C2:C8) weights each driver's minutes per drop by their deliveries. There is no built-in weighted average function.

Why is my Excel average wrong?

Check what AVERAGE skipped and what it counted. Text numbers, such as "5" stored as text, are skipped. Zeros are counted. Compare =SUM(range)/COUNT(range) with AVERAGE, and use COUNT to see how many cells were really numbers.

What is the difference between AVERAGE and MEDIAN?

AVERAGE adds everything and divides by the count, so one extreme value moves it. MEDIAN is the middle number once the list is sorted, so it barely moves. If the two are far apart, there is probably an outlier.

What happens when the range contains an error?

AVERAGE passes the error on, so one #N/A in the range makes the whole result #N/A. Fix the source cell, or in Microsoft 365 average the cleaned values with =AVERAGE(IFERROR(C2:C8,"")). Older versions need Ctrl+Shift+Enter for that array formula.

Sources

Keep going

Guides people read next.