Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default 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?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default 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?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default 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?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default 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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Average only cells that contain numbers April Excel Worksheet Functions 3 April 24th 23 09:07 AM
Excel-only average cells if two cells in same row, meet two condit Eulie-Denver Excel Worksheet Functions 5 October 5th 06 11:15 PM
average formula ingoring empty cells jenparker1234 Excel Worksheet Functions 3 July 12th 06 04:42 AM
omiting cells in average calcs Blackstar79 Excel Discussion (Misc queries) 3 April 25th 06 11:12 PM
30 Day Moving Average Ignoring Blank Cells ethatch Excel Worksheet Functions 2 January 17th 06 09:37 AM


All times are GMT +1. The time now is 03:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"