+ Reply to Thread
Results 1 to 8 of 8

Using Filter to Exclude Data from Calculations

  1. #1
    Registered User
    Join Date
    03-25-2024
    Location
    Gillingham, Dorset
    MS-Off Ver
    365
    Posts
    3

    Using Filter to Exclude Data from Calculations

    I have a complex table which is, to some extent, beyond my control as it's data pasted from another application. In an ideal world, I'd like to be able to pivot this data, but the structure of the data doesn't really allow for that.

    So, my workaround is to use the formula below;

    =SUMIFS(Data!O:O,Data!$BO:$BO,1)

    This works perfectly well. However, I'd like to be able to use the drop down filters on the original data set and have my inclusions/exclusions reflected in this formula. I noted an article which referred to the 'LET' and 'visible' functions used together, but I'm afraid that I hit the wall of talent on trying to decipher it.

    I would be grateful for any suggestions!

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,970

    Re: Using Filter to Exclude Data from Calculations

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: HOW TO ATTACH YOUR SAMPLE WORKBOOK). Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. The sample layout accurately matches that of your real data. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    03-25-2024
    Location
    Gillingham, Dorset
    MS-Off Ver
    365
    Posts
    3

    Re: Using Filter to Exclude Data from Calculations

    Demo workbook attached.

    If I filter on Column AL in the Data tab (or any column on the Data tab, really), I'd like the values in Table B2:O12 to reflect my inclusions/exclusions.
    Attached Files Attached Files

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,915

    Re: Using Filter to Exclude Data from Calculations

    If you can add a column to the right of the source data table using a formula like:
    =SUBTOTAL(3,A2)
    copied down, you can then add this in as another criterion to your existing formulas, filtering for 1 (visible rows will return 1, empty ones 0, as long as there is always data in that column for each row).
    Rory

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,081

    Re: Using Filter to Exclude Data from Calculations

    Using a helper col with the formula Rorya posted (I put it in col EV) In B2 on the Table sheet dragged right you could use
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,915

    Re: Using Filter to Exclude Data from Calculations

    Or clear B2:O12 and then enter this in B2:

    =LET(sumData,Data!O:AB,criteria,Data!$BO:$BY,IsVis,Data!$EV:$EV,sq,SEQUENCE(COLUMNS(criteria)),DROP(REDUCE(0,sq,LAMBDA(status,current,VSTACK(status,BYCOL(sumData,LAMBDA(c,SUM(SUMIFS(c,INDEX(criteria,0,current),{1,2},IsVis,1))))))),1))

  7. #7
    Registered User
    Join Date
    03-25-2024
    Location
    Gillingham, Dorset
    MS-Off Ver
    365
    Posts
    3

    Re: Using Filter to Exclude Data from Calculations

    Superb, thank you! The first solution posted worked perfectly, thank you.

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,081

    Re: Using Filter to Exclude Data from Calculations

    Glad to help & thanks for the feedback.

+ 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] Exclude one Value from a Filter
    By sherylt13 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-24-2018, 12:44 PM
  2. Replies: 1
    Last Post: 01-11-2018, 05:22 PM
  3. Sumifs exclude cells that are hidden with data filter
    By rhyan66 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-18-2013, 10:16 AM
  4. Replies: 3
    Last Post: 11-09-2013, 11:50 PM
  5. Checkbox to exclude numbers from calculations
    By robin183 in forum Excel General
    Replies: 3
    Last Post: 03-28-2010, 01:52 PM
  6. [SOLVED] Worksheet Calculations Exclude Custom Formula
    By Geoff in forum Excel General
    Replies: 4
    Last Post: 06-16-2005, 12: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