Averageifs: what do I do wrong? It's always the Blanks that cause problems!!

Hans Troost

New Member
Joined
Jan 6, 2015
Messages
30
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi all,

In a spreadsheet with I have i column computing the average of the 3 preceding columns. I filled only a few rows at the top, the others will be filled during time (1 row per day).
Of course I already formatted the whole sheet and every row is filled with the Average-formula.

Because I am aware of 0's and blanks I use the Averageifs-function to avoid problems, but no: still #DIV/0!'s in the colums.

The formula is: =ROUND(AVERAGEIFS(B7:D7;B7:D7;"<>0";B7:D7;"<>""");1)

It seems to work for rows where only one of the columns is filled: then it ignores the blanks in the other 2. But if all 3 are blank: doesn't work.

Do I do something wrong?

It shows like this:

MrExcel-Averageifs.png


and this is the spreadsheet.

Thanks in advance for any help!

Regards,
Hans Troost
 
Last edited:

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Thanks, I will try and it expect it to work, but why (why, why) doesn't the Averageifs-function as I use it do the job?
Why do we always have to fight against blanks (and zero's) in XL-formula's. Ok: I shouldn't ask you (nor here) but sometimes I get really tired of it....
 
Last edited:
Upvote 0
Thanks again Andrew,

Due to your recommendation (the iferror) I also left out the IFS from Averageifs and decided to simplify it to =IFERROR(ROUND(AVERAGE(B3:D3);1);"").

The spreadsheet now works as I want. And yes, I agree with Rada1 that indeed it is math's not XL the dividing by 0, but I still doubt about the handling of blanks (= empty cells)

Best regards,

Hans
 
Upvote 0
It handled the blanks just fine if there is at least 1 number in the range.

The reason for the Div/0 is because all 3 cells were blank (as you said).
If all 3 are blank, then there are no numbers to average..

Average is SUM devided by COUNT.
If there are no numbers in the range, then the SUM is 0, and the count is also 0, so it's 0 devided by 0 = #Div/0!
 
Upvote 0
Thanks Jonmo1,

I understand now, thanks to your explanation and I will take it into account in future (similar) formula-problems.

Hans
 
Upvote 0
You're welcome..


Also..

Average / AverageIF / AverageIFS will ignore blanks and text by default anyway, so there's no need to include that criteria...
So you only need to use NOT=0 as a criteria..
And only 1 criteria means AveragIF instead of ifS

Try
=IFERROR(ROUND(AVERAGEIF(B7:D7;"<>0");1);0)
 
Upvote 0

Forum statistics

Threads
1,215,480
Messages
6,125,050
Members
449,206
Latest member
Healthydogs

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top