Free, no sign-up required

AVERAGEIF / AVERAGEIFS Formula Generator

Describe what you want to average and under what conditions, in plain English, and get a ready-to-use AVERAGEIF or AVERAGEIFS formula for Excel or Google Sheets.

5 free tries without an account

AVERAGEIF and AVERAGEIFS syntax

Syntax
=AVERAGEIF(range, criteria, [average_range])
=AVERAGEIFS(average_range, criteria_range1, criteria1, [criteria_range2, criteria2, ...])

Use AVERAGEIF for a single condition, AVERAGEIFS when you need two or more conditions to all be true. Note the argument order flips: AVERAGEIF puts average_range last, AVERAGEIFS puts it first. Formulon figures out which one you need and gets the argument order right automatically.

Examples

Average test scores for one class

=AVERAGEIF(B:B,"Class A",C:C)

Checks every cell in column B, and for each one that equals "Class A", averages the corresponding score in column C.

Average sales for a region AND a specific month

=AVERAGEIFS(D:D,B:B,"West",C:C,"Jan")

Averages column D, but only for rows where column B equals "West" AND column C equals "Jan" — both conditions must be true.

Frequently asked questions

What's the difference between AVERAGEIF and AVERAGEIFS?

AVERAGEIF averages a range based on a single condition. AVERAGEIFS averages based on two or more conditions that all have to be true at once. The argument order also flips: AVERAGEIF is (range, criteria, average_range), AVERAGEIFS is (average_range, range1, criteria1, ...).

Does AVERAGEIF ignore blank cells?

Yes — both AVERAGEIF and AVERAGEIFS only average cells that actually match the criteria and contain a number, so blank or text cells in average_range are excluded rather than counted as zero.

Is AVERAGEIF the same in Google Sheets?

Yes, the syntax and argument order are identical in Excel and Google Sheets for both AVERAGEIF and AVERAGEIFS.

Why is my AVERAGEIF returning #DIV/0!?

This happens when no cells match the criteria at all — there's nothing to average, so Excel effectively divides by zero. Double-check the criteria text matches the source data exactly.

Don't want to write it by hand?

Describe what you need in plain English and get a ready-to-use formula in seconds.

Try the formula generator