SQLExcelHTML & CSSTouch typingBlogChoose a course
Lurndo › Blog › Excel
  1. Short answer
  2. What do AVERAGEIF and AVERAGEIFS do?
  3. How do you write AVERAGEIF and AVERAGEIFS?
  4. How do you calculate an average per category?
  5. How do you use criteria in AVERAGEIF?
  6. How do you calculate an average with multiple conditions?
  7. How do you leave zeros out of an average?
  8. Why isn't my AVERAGEIF working?
  9. Which functions are like AVERAGEIF?
  10. Frequently asked questions

AVERAGEIF and AVERAGEIFS examples: one condition or several, and why you get #DIV/0!

Two functions with nearly the same name and their arguments in a different order. On a charity shop's real sheet you'll see when to use which, and where an average can lead you astray.

C

Christophe, founder of Lurndo
November 6, 2026 · 7 min read

AVERAGEIF takes the average of the numbers that meet one condition, as in =AVERAGEIF(B2:B16,"Clothing",C2:C16). For several conditions, use AVERAGEIFS, with the average range first: =AVERAGEIFS(C2:C16,B2:B16,"Clothing",E2:E16,"Sophie"). If no row fits, both return #DIV/0!, because there's nothing to average. Use ">0" to leave zeros out of it.

Exercise: right in your browser, on real data

Practise this: the lesson on AVERAGEIF, free

Sources: 3 sources you can check

A paper balance with a small stack of green spreadsheet cells on each side, level on a round pivot, with a few grey cells left lying beside it, on light green paper.

What do AVERAGEIF and AVERAGEIFS do?

AVERAGEIF takes the average of the numbers that meet one condition, AVERAGEIFS of the numbers that meet all your conditions. =AVERAGEIF(B2:B16,"Clothing",C2:C16) returns £7.67, the average price of an item of clothing. In a Dutch copy of Excel, the functions are called GEMIDDELDE.ALS and GEMIDDELDEN.ALS.

Every example uses a week of sales at the Second Chance charity shop in Gloucester, the fourth client in our Excel course. If you'd rather learn it step by step, follow the lesson on averages with a condition. If you're after the plain average, a weighted average or how AVERAGE itself works, read how to calculate an average. This article is about the versions with a condition.

How do you write AVERAGEIF and AVERAGEIFS?

The names differ by one letter, but the order is different too. AVERAGEIF has the numbers last, and that argument is optional (Microsoft). AVERAGEIFS has them first, followed by up to 127 pairs of a range and its criteria (Microsoft).

=AVERAGEIF(range,criteria,[average_range])
=AVERAGEIFS(average_range,criteria_range1,criteria1,[criteria_range2,criteria2],…)
AVERAGEIFAVERAGEIFS
ConditionsOneOne or more, up to 127
Numbers goLast, optionalFirst, required
Unequal rangesExcel takes a block in the shape of the range#VALUE!
TRUE or FALSE in the rangeIgnoredTRUE counts as 1, FALSE as 0

To remember it: the plural goes with SUMIFS and COUNTIFS. SUMIFS and AVERAGEIFS both put the numbers first.

With Dutch or Belgian regional settings you'd write =GEMIDDELDE.ALS(B2:B16;"Clothing";C2:C16) and =GEMIDDELDEN.ALS(C2:C16;B2:B16;"Clothing";E2:E16;"Sophie"). If you copy a formula, translate the function name and the separators.

How do you calculate an average per category?

Coordinator Yasmina at Second Chance wants to know what an item of clothing costs on average, and whether that's more than household goods. This is the whole sheet, with all fifteen sales. G2 holds a price limit of £10.

RowA: ItemB: CategoryC: Price (£)D: DayE: Volunteer
2Dress greenClothing12MonSophie
3Book fictionBooks2MonOmar
4LampHousehold8TueSophie
5T-shirt SClothing3TueGrace
6Dressing gownClothing6WedOmar
7PuzzleToys4WedGrace
8Book cookingBooks3ThuSophie
9RadioElectrical15ThuOmar
10T-shirt XLClothing4FriSophie
11Dress blackClothing18FriGrace
12What? GameToys5SatOmar
13VaseHousehold7SatGrace
14T-shirt MClothing3SatSophie
15BookendHousehold9SatOmar
16Kids' bikeToys35SatGrace
=AVERAGEIF(B2:B16,"Clothing",C2:C16)

The formula returns £7.67. AVERAGEIF finds Clothing in column B, gets six rows and divides their £46 by 6. With "Household" you get £8: the lamp, the vase and the bookend come to £24, divided by 3. So there's Yasmina's answer: household goods are just a little dearer.

Try it yourself with a category that has a story to tell. The exercise runs on Second Chance's real sheet, and you type the formula as you would in Excel.

Try it: what do toys cost on average?

What does a toy cost on average? Work it out in I2 with AVERAGEIF.

ABCDEFGHIJ
1ItemCategoryPriceDayVolunteerLimit
2Dress greenClothing£12.00MonSophie£10.00
3Book fictionBooks£2.00MonOmar
4LampHousehold£8.00TueSophie
5T-shirt SClothing£3.00TueGrace
6Dressing gownClothing£6.00WedOmar
7PuzzleToys£4.00WedGrace
8Book cookingBooks£3.00ThuSophie
9RadioElectrical£15.00ThuOmar
10T-shirt XLClothing£4.00FriSophie
11Dress blackClothing£18.00FriGrace
12What? GameToys£5.00SatOmar
13VaseHousehold£7.00SatGrace
14T-shirt MClothing£3.00SatSophie
15BookendHousehold£9.00SatOmar
16Kids' bikeToys£35.00SatGrace
17
I2

Your formula ran in your own browser, on a real calculation engine. Then we run it again on a hidden version of the sheet, with other prices, so copying the answer won't help.

How do you use criteria in AVERAGEIF?

Just as in SUMIF: text and operators go in quotation marks, you join a cell on with &, and wildcards work too (Microsoft). If you test the same column you're averaging, you can drop the third argument.

QuestionFormulaResult
Grace's average item=AVERAGEIF(E2:E16,"Grace",C2:C16)£13.40
Everything under £10=AVERAGEIF(C2:C16,"<10")£4.91
Everything above the limit in G2=AVERAGEIF(C2:C16,">"&G2)£20
Anything starting with Dress=AVERAGEIF(A2:A16,"Dress*",C2:C16)£12

The sheet as a whole comes to £8.93, with =AVERAGE(C2:C16). Grace is well above that, but it says little about her: she happened to sell the kids' bike. A comparison like that is only fair once you know what's behind the number.

How do you calculate an average with multiple conditions?

With AVERAGEIFS: the numbers first, then the pairs, just like SUMIFS. Only the rows where every condition holds count. =AVERAGEIFS(C2:C16,B2:B16,"Clothing",E2:E16,"Sophie") returns £6.33: Dress green, T-shirt XL and T-shirt M together make £19, divided by 3.

Between two values, you use the same column twice. =AVERAGEIFS(C2:C16,C2:C16,">=5",C2:C16,"<=10") returns £7 for the five items from £5 to £10. That's also how you leave outliers out: =AVERAGEIFS(C2:C16,B2:B16,"Toys",C2:C16,"<"&G2) returns £4.50 for the toys under the limit. Try it yourself.

Try it: Saturday without the toys

What did an item cost on average on Saturday, leaving out the toys? Work it out in I2 with AVERAGEIFS.

ABCDEFGHIJ
1ItemCategoryPriceDayVolunteerLimit
2Dress greenClothing£12.00MonSophie£10.00
3Book fictionBooks£2.00MonOmar
4LampHousehold£8.00TueSophie
5T-shirt SClothing£3.00TueGrace
6Dressing gownClothing£6.00WedOmar
7PuzzleToys£4.00WedGrace
8Book cookingBooks£3.00ThuSophie
9RadioElectrical£15.00ThuOmar
10T-shirt XLClothing£4.00FriSophie
11Dress blackClothing£18.00FriGrace
12What? GameToys£5.00SatOmar
13VaseHousehold£7.00SatGrace
14T-shirt MClothing£3.00SatSophie
15BookendHousehold£9.00SatOmar
16Kids' bikeToys£35.00SatGrace
17
I2

How do you leave zeros out of an average?

Use ">0" as the criteria on the numbers themselves. At The Splash swimming pool in Tamworth, manager Dave recorded the visits of ten members. Laura's cell is empty, and Sara has never been. =AVERAGE(D2:D11) returns 9.78 visits, because Sara's 0 counts and Laura's empty cell doesn't. =AVERAGEIF(D2:D11,">0") returns 11 visits, the average of those who actually came.

Which number is right depends on your question. How often does a member come on average? Then Sara counts. How often does someone who comes, come? Then she doesn't. The function skips an empty cell anyway (Microsoft), so watch the difference between "not filled in" and "really zero". There's more on that in the article on AVERAGE.

Why isn't my AVERAGEIF working?

An average can go wrong in three ways: it gives an error, it works on the wrong rows, or it's mathematically right but misleading. That last one is the most dangerous, because Excel won't complain.

The formula returns #DIV/0!

No row meets the condition, or there are no numbers in the cells you're averaging (Microsoft). No furniture was sold, so =AVERAGEIF(B2:B16,"Furniture",C2:C16) returns #DIV/0!. That's an honest answer: there is no average. If you'd like to show something readable, write:

=IFERROR(AVERAGEIF(B2:B16,"Furniture",C2:C16),"No sales")

Don't replace it with a 0: an average of £0 isn't the same as no average. Microsoft warns that IFERROR suppresses every error (Microsoft). You can read when that does harm in IFERROR and IFNA.

The ranges are shifted

AVERAGEIF doesn't check the size of the last range: Excel starts at its first cell and takes a block in the same shape as the first range (Microsoft). So =AVERAGEIF(B2:B16,"Clothing",C3:C16) returns £7.33 instead of £7.67, with no message at all. AVERAGEIFS is stricter: each criteria range must be the same size and shape as the average range (Microsoft).

An average of averages is wrong

Take the average of the five category averages and you get £9.57, while the true average is £8.93. Every category then counts equally, whether it has one item like Electrical or six like Clothing.

Never average a set of averages. Go back to the raw rows, or weight each average by its count.

Which functions are like AVERAGEIF?

The family holds no secrets by now: the same criteria, the same pairs, a different calculation. On Second Chance's sheet, for Sophie's clothing:

FunctionWhat it doesResult
COUNTIFSCounts the rows3 items
SUMIFSAdds up the prices£19
AVERAGEIFSTakes the average, which is sum divided by count£6.33

To count, read COUNTIFS with examples. For amounts, there's SUMIFS with examples. Every function is on the Excel cheat sheet with its Dutch name. If you want to do all of this yourself, follow module 4 of the Excel course, and start with the free modules if you're new to Excel.

Frequently asked questions

What's the difference between AVERAGEIF and AVERAGEIFS?

AVERAGEIF has one condition, AVERAGEIFS one or more, up to 127. The order differs too. AVERAGEIF has the range of numbers last, and you can even leave it out. AVERAGEIFS has it first, just like SUMIFS, and all its ranges must be the same size and shape.

Why does AVERAGEIF return

Because no row meets the condition, or because the cells you're averaging are empty or hold text. An average is a sum divided by a count, and without numbers you divide by zero. Catch it with IFERROR, or first test with COUNTIF whether there are any matching rows.

How do you calculate an average without zeros?

Use the criteria ">0" on the numbers themselves: =AVERAGEIF(D2:D11,">0"). You can drop the third argument, because you test and average in the same column. The function skips empty cells anyway, and zeros only if you ask it to. Do think about whether a 0 really shouldn't count.

Can AVERAGEIF use text and wildcards?

Yes. Text goes in quotation marks and capitals don't matter. Use * for a run of characters and ? for exactly one, as in "Dress*" for anything starting with Dress. To find a real question mark or asterisk, put a tilde in front: ~? or ~*. The same rules apply to AVERAGEIFS.

How do you round the result of AVERAGEIF?

Wrap ROUND around it: =ROUND(AVERAGEIF(B2:B16,"Clothing",C2:C16),2) returns 7.67. If you only want to show fewer decimals, use a number format on the cell instead: the full value stays behind it, so later calculations don't drift. Round when the rounded number itself needs to carry on.

Practise this in the course

Every lesson explains first and then lets you practise yourself, with a real spreadsheet in your browser.

  • AVERAGEIFCounting and adding with conditions · An average with a condition
  • SUMIFSCounting and adding with conditions · Several conditions
  • AVERAGEFunctions and references · The average
Start Excel for free

Sources

  1. Microsoft Support, AVERAGEIF function
  2. Microsoft Support, AVERAGEIFS function
  3. Microsoft Support, How to correct a
C

Christophe, founder of Lurndo

Christophe builds Lurndo from Belgium, with short, playful exercises for SQL, Excel, HTML & CSS and touch typing that show straight away what your answer does. On this blog, Christophe answers the questions people run into while learning, with sources you can check yourself.

Read next

  • Excel COUNTIFS examples: counting with multiple criteria, including between two valuesHow many items over £5 did Grace sell? On a charity shop's real sheet you'll see how COUNTIFS counts row by row, and you can write one yourself right away.Excel · November 6, 2026 · 7 min read
  • IFERROR and IFNA in Excel: catching errors without hiding the real onesA #DIV/0! or #N/A looks messy, but it's information too. On the sheets of a swimming pool and a bike courier, you'll see how to catch them neatly, and when to leave them alone.Excel · November 6, 2026 · 6 min read

SQL

  • Topics
  • All lessons
  • Cheat sheet
  • Sandbox

Excel

  • Topics
  • All lessons
  • Cheat sheet
  • Shortcuts

HTML & CSS

  • Topics
  • All lessons
  • Cheat sheet

Touch typing

  • Topics
  • All lessons
  • Cheat sheet
  • Typing test

Lurndo

  • Dashboard
  • Leaderboard
  • Premium
  • Account
  • Blog
  • FAQ
  • Contact & support
  • Privacy

Ask AI about Lurndo

Nederlands