average values in non-contiguous cells, ignoring 0 values
One way, assuming the noncontiguous range is G7:G9,G12:G14
=SUM(G7:G9,G12:G14)/SUMPRODUCT((G7:G9<0)+(G12:G14<0))
"RWormdahl" wrote:
How do I average the values in non-contiguous cells, while ignoring cells
with 0 values? I tried the average function, but the IF conditional seems to
recognize only contiguos cells. I keep getting the "The formula you entered
contains an error..." message, and cannot execute the F2 ctl+shift+enter
command.
Any ideas?
|