AVERAGEIFS function - ignore blanks and add qualifying "if" statement

clairestill

New Member
Joined
Jun 26, 2018
Messages
3
I have this formula that works to be a nonblank average of a column J that matches to a specific answer in column B (A21). Column B has non-numerical values and Column J is the data I'm averaging.

=AVERAGEIF(B3:B20,A3,J3:J20)

When I try to expand this to eliminate "0's" from the averages, it messes up. How to I expand the formula above to only include non-zero answers?

=AVERAGEIFS(...)
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Assuming that Column J does not contain negative numbers, try...

=AVERAGEIFS(J3:J20,B3:B20,A3,J3:J20,">0")

Hope this helps!
 
Last edited:
Upvote 0
Assuming that Column J does not contain negative numbers, try...

=AVERAGEIFS(J3:J20,B3:B20,A3,J3:J20,">0")

Hope this helps!


Thank you so much for your prompt response!

I'm getting a "#DIV/0!" error response. There are no negative values, but there are blank cells. Can blanks cause an issue? (I simplified the version of the formula I put in here, it includes hundreds of cells)
 
Upvote 0
The formula will return #DIV/0! if there are no rows that meet the criteria. If there are indeed rows that meet the criteria, the numbers in Column J are likely being recognized as text values instead of numerical values. These numbers formatted as text values can easily be converted into numerical values as follows...

Code:
1) select an empty cell

2) click on Copy

3) select the range of cells in Column J containing the data or simply select the whole column

4) select PasteSpecial > Add > OK

Does this help?
 
Upvote 0
The formula will return #DIV/0! if there are no rows that meet the criteria. If there are indeed rows that meet the criteria, the numbers in Column J are likely being recognized as text values instead of numerical values. These numbers formatted as text values can easily be converted into numerical values as follows...

Code:
1) select an empty cell

2) click on Copy

3) select the range of cells in Column J containing the data or simply select the whole column

4) select PasteSpecial > Add > OK

Does this help?

YES, that completely helped. I was making the formula in a cell referencing an item that is not currently listed in the data set. However when I pulled the formula down to a cell with currently entered reference data it worked! (if that makes sense)

Thank you SO MUCH.
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,885
Members
452,364
Latest member
springate

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