+ Reply to Thread
Results 1 to 4 of 4

calculate average excluding both Filtered rows & 0 value in cells

  1. #1
    Registered User
    Join Date
    02-08-2021
    Location
    Australia
    MS-Off Ver
    365
    Posts
    10

    calculate average excluding both Filtered rows & 0 value in cells

    Hello Excel Gurus,

    I am trying using =Averageif(Range, ">0") function or =Subtotal(101,range) function but unable to get the desired result.

    I need to get the average of cells excluding filtered activity & excluding 0 values in container cell. Can someone help out?

    For instance, If I use filter activity - "Preparing Pallets" then it will return with container values & some 0's. I need to calculate the average of container/min excluding 0 & the filtered cells.

    Please let me know if you need anything else.

    Thanks,
    Varun
    Attached Files Attached Files

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: calculate average excluding both Filtered rows & 0 value in cells

    AVERAGE=SUM/COUNT

    to COUNT:
    =SUMPRODUCT(SUBTOTAL(3,OFFSET($B$2,ROW($B$2:$B$238)-MIN(ROW($B$2:$B$238)),,1))*($B$2:$B$238>0))

    to SUM:
    =SUMPRODUCT(SUBTOTAL(3,OFFSET($B$2,ROW($B$2:$B$238)-MIN(ROW($B$2:$B$238)),,1))*($B$2:$B$238>0)*$B$2:$B$238)

    Then final AVERAGE formula:

    Please Login or Register  to view this content.
    Last edited by bebo021999; 04-28-2021 at 10:32 PM.
    Quang PT

  3. #3
    Registered User
    Join Date
    02-08-2021
    Location
    Australia
    MS-Off Ver
    365
    Posts
    10

    Re: calculate average excluding both Filtered rows & 0 value in cells

    Hello bebo,

    I tried using this formula but I need to take the average from Column not Row B.
    I tried changing the formula from B to C but didn't bring the right values.

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: calculate average excluding both Filtered rows & 0 value in cells

    Quote Originally Posted by varunistician View Post
    I tried changing the formula from B to C but didn't bring the right values.
    I guess you have changed B:B inside the OFFSET also. It should not be changed, because it is filter criteria.

    Please Login or Register  to view this content.

+ 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. [SOLVED] Calculate average excluding 0 and negative numbers
    By owais0937 in forum Excel General
    Replies: 4
    Last Post: 05-16-2019, 06:20 AM
  2. Calculate average excluding zeros in a non continguous range
    By PostMaloney in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-13-2019, 11:34 AM
  3. Replies: 0
    Last Post: 06-19-2017, 09:14 PM
  4. [SOLVED] Calculate 'average' between data range of days but excluding weekends(?)
    By iliasark in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-08-2013, 04:39 AM
  5. VBA Macro to Calculate Average excluding Duplicates
    By dani_n88 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-04-2012, 07:55 PM
  6. The rank of average ranks excluding empty cells but including their average.
    By Terminal45 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-21-2012, 03:44 AM
  7. Calculate average excluding cells on conditions
    By Kfetterman1 in forum Excel General
    Replies: 0
    Last Post: 09-26-2006, 07:34 PM

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