LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 563
Default Averaging every 5th cell while omitting zeros

How about making the numerator
=SUMPRODUCT(--(MOD(ROW(A7:A272),5)=2),--(A7:A272<0),--(ISNUMBER(A7:A272)))
Seems to work on my test data
Bernard

"Mike H" wrote in message
...
Bernard,

While that works I think the problem is it will treat text as a numeric
value of zero and include it in the average and I was striving for a more
bullet proof answer. Now given the OP's data is probably numeric my
criticism
is probably not valid but I still think there's a better solution but I'm
going to bed.

Regards,
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Bernard Liengme" wrote:

An alternative to Mike's solution
=SUMPRODUCT(--(MOD(ROW(A7:A272),5)=2),--(A7:A272<0),A7:A272)/SUMPRODUCT(--(MOD(ROW(A7:A272),5)=2),--(A7:A272<0))
This is NOT an array formula
I tested it with some data. I used this formula and some helper columns-
got
the same answer so I have faith init
Note the test --(A7:A272<0) will exclude zeros but include negative
values
Change it to --(A7:A2720) to include only positive non-zero numbers
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"Erika" wrote in message
...
Greetings! Thank you for your interest in my question, I have been
bashing
my
head in trying to figure it out. In a column, I want to add every FIFTH
cell
starting with row 7 and ending with row 272. Meanwhile, I need to
exclude
all
the cells with zero so the averaging only divides by the number of
cells
with
a numeral. I have tried entering each 5th row individually in various
formulas and I have tried defining a name and using that in the
formulas
but
nothing has worked, I keep getting an error each time. I would really
appreciate any help! Thank you.


.



 
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
Omitting Zeros in a chart spudsnruf Excel Discussion (Misc queries) 2 September 2nd 09 06:53 PM
Averaging, but excluding zeros Tami Excel Worksheet Functions 5 August 11th 09 01:47 AM
Averaging blank or cells with Zeros in them. Glenn Excel Worksheet Functions 4 January 4th 09 10:51 PM
Averaging with zeros NOT Tom Excel Discussion (Misc queries) 5 August 18th 05 07:34 PM
Averaging, ignoring zeros Mark Excel Worksheet Functions 5 February 28th 05 10:25 PM


All times are GMT +1. The time now is 10:38 AM.

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"