Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / October 2006

Tip: Looking for answers? Try searching our database.

average values in non-contiguous cells, ignoring 0 values

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RWormdahl - 30 Oct 2006 01:11 GMT
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 - 30 Oct 2006 01:37 GMT
One way, assuming the noncontiguous range is G7:G9,G12:G14

=SUM(G7:G9,G12:G14)/SUMPRODUCT((G7:G9<>0)+(G12:G14<>0))

> 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 - 30 Oct 2006 02:01 GMT
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/community/en-us/default.mspx?&lang=en&cr=US&guid
=&sloc=en-us&dg=microsoft.public.excel.worksheet.functions&p=1&tid=85a75973-16b5
-44b9-8731-a176771b3353&mid=505324da-5176-4023-bab6-53b7536f6155


> One way, assuming the noncontiguous range is G7:G9,G12:G14
>
[quoted text clipped - 6 lines]
> > command.
> > Any ideas?
JMB - 30 Oct 2006 02:06 GMT
Or it could be modified

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

> One way, assuming the noncontiguous range is G7:G9,G12:G14
>
[quoted text clipped - 6 lines]
> > command.
> > Any ideas?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.