+ Reply to Thread
Results 1 to 4 of 4

Count a filtered list but exclude the zeros

  1. #1
    Registered User
    Join Date
    11-24-2014
    Location
    Paris, France
    MS-Off Ver
    2010
    Posts
    2

    Count a filtered list but exclude the zeros

    I am writing a macro to get an average for a filtered list. However, in order to calculate the correct average, I need to exclude the zeros in the list

    So I have a filtered list like

    17,82
    16,92
    17,28
    17,46
    16,74
    17,46
    17,1
    17,46
    0
    0
    0
    0
    0
    0
    0
    0

    so the average should be 138/8

    How can achieve this
    1) In Excel
    2) In a macro.

    Thanks

    Colin

  2. #2
    Forum Contributor
    Join Date
    01-30-2013
    Location
    Wales
    MS-Off Ver
    Excel 2013
    Posts
    231

    Re: Count a filtered list but exclude the zeros

    I put your data in B5:B19

    =SUM(B5:B19)/COUNTIF(B5:B19,"<>0")
    Last edited by Chris 53; 11-24-2014 at 12:09 PM. Reason: Typo
    Click * below if this answer helped

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Count a filtered list but exclude the zeros

    Adjust ranges as needed

    =AVERAGEIF(A2:A17,">0")
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Registered User
    Join Date
    11-24-2014
    Location
    Paris, France
    MS-Off Ver
    2010
    Posts
    2

    Re: Count a filtered list but exclude the zeros

    Hello,

    Thanks for your replies. I think the AverageIf responds best to my needs.


    Colin

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Count values in column but exclude filtered rows
    By elee532 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-26-2013, 12:53 AM
  2. Replies: 2
    Last Post: 08-10-2007, 08:44 AM
  3. HOW DO I TOTAL A FILTERED LIST TO EXCLUDE THOSE EXCLUDED BY FILTE.
    By Charlie in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-06-2005, 04:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1