+ Reply to Thread
Results 1 to 7 of 7

Include only filtered data in an average formula

  1. #1
    Registered User
    Join Date
    10-10-2012
    Location
    Warks
    MS-Off Ver
    Excel 2013
    Posts
    91

    Include only filtered data in an average formula

    Cells A2:A21 on sheet 1 contain a list of numbers. Cell A1 on sheet 2 represents the average of these numbers. If I was to filter column A on sheet 1 to look for '4' for example I'd like the average in cell A1 of sheet 2 to display the filtered average (so '4').

    With the filtering of column A on sheet 1, column B is also filtered and I'd like the average in cell B1 to also represent the filtered data.

    Thanks in advance for any suggestions.Sample 3.xlsx

  2. #2
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Include only filtered data in an average formula

    Hi Consty1

    Try the AGGREGATE function.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

  3. #3
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Include only filtered data in an average formula

    Hi Consty1,


    Look into subtotal function with function_num as 1 to obtain average of filtered data.



    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  4. #4
    Registered User
    Join Date
    10-10-2012
    Location
    Warks
    MS-Off Ver
    Excel 2013
    Posts
    91

    Re: Include only filtered data in an average formula

    Thank you both for your replies, I've tried the AGGREGATE function and that seems to work fine.

    I'm also wondering if it's possible to apply a filter to a SUM function? For example A2:A21 totals 100, if I was to filter to the number '4' the filtered total would be 24. I'm assuming this filtered SUM total would have to be placed in a different column to which the filtering is taking place.

  5. #5
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Include only filtered data in an average formula

    Hi Consty1

    Use the AGGREGATE again in cell next to the other.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,578

    Re: Include only filtered data in an average formula

    @DILIPandey
    Use subtotals with function values of 100+ to ignore hidden values
    =SUBTOTAL(101, Sheet1!A1:A21)
    or
    =SUBTOTAL(101, Sheet1!B1:B21)
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  7. #7
    Registered User
    Join Date
    10-10-2012
    Location
    Warks
    MS-Off Ver
    Excel 2013
    Posts
    91

    Re: Include only filtered data in an average formula

    Brilliant, thank you both.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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