ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   average values in non-contiguous cells, ignoring 0 values (https://www.excelbanter.com/excel-worksheet-functions/116615-average-values-non-contiguous-cells-ignoring-0-values.html)

RWormdahl

average values in non-contiguous cells, ignoring 0 values
 
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?

JMB

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?


JMB

average values in non-contiguous cells, ignoring 0 values
 
Sorry - that doesn't work if the ranges are not the same size.

See Ragdyer's post here - I think your question is that same as this one:

http://www.microsoft.com/office/comm...6-53b7536f6155

"JMB" wrote:

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?


JMB

average values in non-contiguous cells, ignoring 0 values
 
Or it could be modified

SUM(G7:G9,G12:G15)/(SUMPRODUCT(--(G7:G9<0))+SUMPRODUCT(--(G12:G15<0)))


"JMB" wrote:

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?



All times are GMT +1. The time now is 02:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com