A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Hi,
In cell X17, enter this formula
=LET(rng,INDIRECT(X4:X9),SUM(SUMIF(rng,"<>0",rng))/SUM(COUNTIF(rng,"<>0")))
Hope this helps.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I want to average P3, AF3, P17, AF17, P31 and AF31, but I want to ignore 0 values. The mentioned cells are populated with COUNTA formula and some will have 0 items to count.
I've tried using this formula: =AVERAGEIF(P3,AF3,P17,P31,AF31, "<>0") but I get TOO MANY ARGUMENTS error.
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author
Answer accepted by question author
AVERAGEIF only works with a contiguous range.
So one option would be to use formulas to return the values of P3, AF3 etc. in a contiguous range of cells, and use that range in your AVERAGEIF formula.
Another one would be to use an awkward formula like this:
=AVERAGE(IF(P3<>0,P3),IF(AF3<>0,AF3),IF(P17<>0,P17),IF(P31<>0,P31),IF(AF31<>0,AF31))
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more