NUMBERS -Using SMALL and IF to exclude 0

User uploaded fileI am trying to calculate the average of the lowest 6 numbers in an array. I do not wish to include 0. I have tried a SMALL formula, which works, but I cannot exclude the zeros. I have tried IF and COUNT IF, but can't get them to work. Any advice welcome.

Posted on May 16, 2016 8:23 AM

Reply
9 replies

May 18, 2016 1:24 AM in response to DiggleA

Here's an easier to read formula set made by breaking the process into three components:

  • Count the zeroes
  • Extract the six smallest non-zero values
  • Calculate the average of the extracted values

User uploaded file

Data is recorded on the Data table to the left. All calculations are done on the Average table to the right.


A2: =COUNTIF(Data::A,0)


B2, filled to B7: =SMALL(Data::A,ROW()−1+$A$2)


B8 (row 8 is a Footer Row): =AVERAGE(B)


Should you ever want to include more (or fewer) than 6 values in the average, all that is required is to add rows to the body of the Average table (or delete body rows from the table). Numbers will djust the extraction formula as needed. The other two formulas will rmain the same as they are.


Regards,

Barry

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

NUMBERS -Using SMALL and IF to exclude 0

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.