How to Calculate Average If Cell Is Not Blank in Excel

In this article, we will discuss two suitable ways to calculate an average of cells that are not blank.

Suppose we have a dataset that contains information about different types of Products and the quantity of each that has been ordered in different Months in columns C, D, and B respectively. We’ll calculate an average of the Quantity of those ordered products excluding the blank orders that appear in several months, using the AVERAGEIF, SUMIFS, and COUNTIFS functions.

excel average if not blank


Method 1 – Using the AVERAGEIF Function to Calculate the Average If a Cell Is Not Blank

First, we will apply the AVERAGEIF function to calculate the average if the cells are not blank in two cases: in a single column and in multiple columns.


1.1  – The AVERAGEIF Function in a Single Column

Let’s calculate the average of the cell values of the Quantity column only where the cell values in the Product column are not blank.

Steps:

  • Merge cells E5 to E15. Then select the merged cells.
  • Enter the following AVERAGEIF function in the Formula Bar:
=AVERAGEIF(C5:C15,"<>",D5:D15)

Where:

  • C5:C15 is the cell range of the function.
  • “<>” is the criteria.
  • D5:D15 is the average_range.

Use AVERAGEIF Function to Calculate Average If Cell Not Blank

  • Press Enter to get an average of 78.57.

  • If we count the cells that have blanks, the average becomes 77.56.

Use AVERAGEIF Function to Calculate Average If Cell Not Blank

Read More: How to Calculate Average If Number Matches Criteria in Excel


1.2 – Applying the AVERAGEIFS Function in Multiple Columns

Now we will calculate the average of the cell values of the Quantity column only where the cell values in the Product and Month columns are not blank.

Steps:

  • Merge cells E5 to E15. Then select the merged cells.
=AVERAGEIFS(D5:D15,C5:C15,"<>",B5:B15,"<>")

Where:

  • D5:D15 is the cell average_range.
  • C5:C15 is criteria_range1.
  • “<>” is criteria1.
  • B5:B15 is criteria_range2.
  • “<>” is criteria2.

  • Press Enter to return an average of the cells that are not blank of 79.33.

Use AVERAGEIFS Function to Calculate Average If Cell Not Blank

Read More: How to Use Excel AVERAGEIF with Multiple Criteria


Method 2 – Combining the SUMIFS and COUNTIFS Functions to Calculate the Average If Cells Are Not Blank

Last but not least, we will merge the SUMIFS and COUNTIFS functions to calculate the average of the non-blank cells.

Steps:

  • Select cell E5.
  • Enter the following formula:
=SUMIFS(D5:D15,D5:D15,">=0")/COUNTIFS(D5:D15,">=0")

Formula Breakdown:

  • Inside the SUMIFS function, the first D5:D15 is the sum_range.
  • The second D5:D15 is the criteria_range.
  • “>=0” is the criteria of the SUMIFS function.
  • Inside the COUNTIFS function, D5:D15 is the criteria_range.
  • “>=0” is the criteria.
  • Press Enter.

The average if cells are not blank is 81.

Combine SUMIFS and COUNTIFS Functions to Calculate Average If Cell Not Blank

Read More: Excel AVERAGEIF Function for Values Greater Than 0


Things to Remember

The AVERAGEIF Function returns a #DIV/0! error if any referenced cell is non-numeric.


Download Practice Workbook


Related Articles


<< Go Back to Excel AVERAGEIF Function | Excel Functions | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Md. Abdur Rahim Rasel
Md. Abdur Rahim Rasel

MD. ABDUR RAHIM is a marine engineer proficient in Excel and passionate about programming with VBA. He views programming as an efficient means to save time while managing data, handling files, and engaging with the internet. His interests extend to Rhino3D, Maxsurf C++, AutoCAD, Deep Neural Networks, and Machine Learning, reflecting his versatile skill set. He earned a B.Sc in Naval Architecture & Marine Engineering from BUET, and now he has become a content developer, creating technical content... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo