Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in


How to ignore blanks when calculate the weighted average in Excel?

In statistic calculation, the weighted average is used more widely than the average function. But do you know how to calculate the weighted average ignoring the blanks in Excel?

For example, there are two columns in a sheet which record the grades and the number of cases of a student, but this student is absent from some cases of examinations which leave the blanks in the column of grades as below screenshot shown. If you apply the normal Weighted Average function =SUMPRODUCT(A2:A5,B2:B5)/SUM(B2:B5), it will get the result 79.333 which is somewhat unfair for the student. In this article, I introduce a formula to calculate the weighted average ignoring blank records in Excel.
doc weighted average ignore zero 1

Calculate weighted ignore blanks

arrow blue right bubble Calculate weighted ignore blanks

Select a blank cell you want to place the result, and type this formula =SUMPRODUCT(A2:A5,$B$2:$B$5)/SUMPRODUCT(--(A2:A5<>""),$B$2:$B$5), and press Enter key. See screenshot:
doc weighted average ignore zero 2

In the formula, A2:A5 is the grade records, B2:B5 is the number of cases. You can change them as you need.

Tip.If you want to quickly sum/count/average visible cells only, please try to use the Kutools for Excel’s Kutools Functions as shown in the following screenshot. It’s full function without limitation in 60 days, please download and have a free trial now.

doc sumvisible

Recommended Productivity Tools

Office Tab

gold star1 Bring handy tabs to Excel and other Office software, just like Chrome, Firefox and new Internet Explorer.

Kutools for Excel

gold star1 Amazing! Increase your productivity in 5 minutes. Don't need any special skills, save two hours every day!

gold star1 300 New Features for Excel, Make Excel Much Easy and Powerful:

  • Merge Cell/Rows/Columns without Losing Data.
  • Combine and Consolidate Multiple Sheets and Workbooks.
  • Compare Ranges, Copy Multiple Ranges, Convert Text to Date, Unit and Currency Conversion.
  • Count by Colors, Paging Subtotals, Advanced Sort and Super Filter,
  • More Select/Insert/Delete/Text/Format/Link/Comment/Workbooks/Worksheets Tools...

Screen shot of Kutools for Excel

Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.