Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default Average not including Zeros/Blanks

Briefly:

(F3:F37<0)

returns an array of 35 TRUE/FALSE values.

--(F3:F37<0)

converts the array to 1/0 (see

http://www.mcgimpsey.com/excel/doubleneg.html

for more explanation).

--(MOD(ROW(F3:F37),8)=2)

returns an array of 35 1s/0s depending on whether each row's row number,
when divided by 8, has a remainder of 2.

Those arrays are multiplied to return an array of 1s/0s (1 for rows for
which the remainder<2 and the value<0).

In the denominator, SUMPRODUCT() then adds those 1/0 to get a count of
valid values.

In the numerator, the arrays are further multiplied by the array of
values in F3:F37. Where both the remainder < 2 and the value <0, the
cell's value is returned in the array. SUMPRODUCT() then adds those
values in the array.

Dividing the sum of valid values by the count of valid values gives the
average.



In article ,
DaS wrote:

That worked great. Thanks JE, also for identifying the whole "bracket"
mix-up. I hate to be a bother, but could you explain how the formula works?

"JE McGimpsey" wrote:

Well, no, it won't.

First, the ranges need to be the same size.

Second, it won't remove the cells the OP wants it to.

This should work:

=SUMPRODUCT(--(MOD(ROW(F3:F37),8)<2), --(F3:F37<0),F3:F37)/
SUMPRODUCT(--(MOD(ROW(F3:F37),8)<2), --(F3:F37<0))

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
formulas blanks vs zeros Dallasbutterfly Excel Discussion (Misc queries) 1 August 30th 07 10:52 PM
Fomat cells for IP address including leading Zeros Pete[_2_] Excel Worksheet Functions 6 June 13th 07 12:55 AM
lookup on Table including blanks - Nir Excel Worksheet Functions 7 October 31st 06 03:25 PM
in excel, how do i get an average without including the zeros? Season Excel Worksheet Functions 10 January 27th 06 10:36 PM
How do I average a column without including zeros KMHarpe Excel Discussion (Misc queries) 3 August 11th 05 04:21 PM


All times are GMT +1. The time now is 12:39 PM.

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

About Us

"It's about Microsoft Excel"