Use AVERAGEIF in Excel to average values that meet a condition

Calculate the average of cells that meet a specific condition using Excel's AVERAGEIF function. Learn the required arguments and see simple examples for numbers, text, and dates.

What the video covers

Show how to write and apply the AVERAGEIF formula in a worksheet to average values that satisfy one criterion.

Watch the video on YouTube

Step-by-step instructions

  1. Prepare your worksheet
    Enter your data into two ranges: one range that contains the criteria (for example, categories or test names) and a corresponding range that contains the numeric values to average (for example, scores or sales).
  2. Select the result cell
    Click the cell where you want the average to appear.
  3. Start the AVERAGEIF formula
    Type =AVERAGEIF( and then select the range that contains the criteria.
  4. Add the criterion
    Type a comma, then enter the condition in quotes (for example, "50" for numbers greater than 50, "Apple" for text, or a date expression). You can also use a cell reference for the criterion (for example, "" & B1).
  5. Specify the average range
    Type a comma and then select the range of cells you want averaged. Close the parentheses and press Enter.
  6. Copy or adjust as needed
    Use the fill handle to copy the formula to other cells or adjust ranges/criteria for additional calculations.

Watch the video

Video thumbnail for Use AVERAGEIF in Excel to average values that meet a condition Play tutorial

Watch on YouTube

Why it matters

AVERAGEIF lets you compute averages for a subset of data (for example, sales above a threshold or scores for a specific student), making analysis more targeted and meaningful.

Check your result

The cell with the formula displays the average of only the values that meet your criterion. If no values match, Excel returns a #DIV/0! error or a similar indicator.

Troubleshooting

If the result is an error or unexpected: confirm the ranges are correct and of equal size; ensure criteria syntax is correct (e.g., "50" for greater than 50); for text criteria match spelling/casing as needed; verify that the average-range actually contains numeric values.