+ Reply to Thread
Results 1 to 5 of 5

Filter that excludes matches from multiple cells

  1. #1
    Registered User
    Join Date
    02-01-2022
    Location
    Bristol, England
    MS-Off Ver
    365
    Posts
    7

    Filter that excludes matches from multiple cells

    Hi everyone,

    I record the themes of enquiries that I see, and there are of course, never enough themes!

    I have a drop down list of commonly occurring themes, as well as a free text section to enter an additional theme when needed.

    Sometimes it is necessary for me to enter one of the drop down themes into the free text section.

    I keep records of how often they occur by having a 'set' list of the common themes, and then a filtered list of the less common themes (with corresponding COUNTIFS).

    I do not want the filtered list of less common themes to repeat the information from the 'set' list.

    Here is the almightily clunky formula I'm currently using which I suspect may be slowing down the whole workbook:

    Please Login or Register  to view this content.
    (H:H<>"") filters out blanks and (J:J=S1) is the way I return stats on a week by week basis.

    Every other bracket after that is simply telling the filter NOT to include the 'set' list of 27 themes, cell by cell.

    There has to be a better, cleaner and simpler way to do this, I would be very keen to hear any suggestions.

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Filter that excludes matches from multiple cells

    you might try something like

    =LET(d,SORT(UNIQUE(FILTER(H:H,(H:H<>"")*(J:J=S1)))),x,M21:M47,FILTER(d,ISNA(MATCH(d,x,0))))

    so, limit the MATCH test to just the valid records rather than running against entire column

  3. #3
    Registered User
    Join Date
    02-01-2022
    Location
    Bristol, England
    MS-Off Ver
    365
    Posts
    7

    Re: Filter that excludes matches from multiple cells

    Thanks very much!

    I replaced my formula with yours and it seemed to be the exact same result, so perfect!

    Of course, I don't fully understand your formula, and would like to.

    D is the sorted list of all the unique values in column H?
    X is the array of set themes?

    If you were happy to elaborate and explain it, I'd find that very useful!

    Thanks again

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Filter that excludes matches from multiple cells

    A few years ok, the paucity of available information (especially from Microsoft) as to which functions employ implicit detection of the last-used cell within the range referenced was such that you could perhaps forgive the widespread use of passing entire column references to functions which don't benefit from said implicit detection. Array formulas and SUMPRODUCT seemed to be particular favourites.

    Now, however, people have started to cotton on to how bad a practice this is, and you can even find official documentation from Microsoft on the topic.

    That said, I've seen comments from some to the effect that their super processing speeds make such concerns irrelevant to them. I consider my PC to be reasonable in that department, though a quick test involving copying the formula from post #1 (which has to process more than 31 million cells - for a single formula a record for me) to a mere 50 cells persuaded my version of Excel to pack it in for the day.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  5. #5
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Filter that excludes matches from multiple cells

    Quote Originally Posted by Astromanatee View Post
    Of course, I don't fully understand your formula, and would like to.

    D is the sorted list of all the unique values in column H?
    X is the array of set themes?
    Yes, that's correct.
    I fully concur with XOR LX's comments re: entire column referencing and, tbh, if we knew more of your setup we would probably restrict the FILTER in the first instance (and/or consider using a Table object / structured references).
    Above aside, based on the info available, the suggestion was to break the calc into 2 parts such that the "more expensive" MATCH calculations were only performed as many times as was strictly necessary - i.e. per unique (valid) value in H

    edit: I should add, it doesn't matter where the SORT is applied, be that D or the final FILTER; the UNIQUE, however, should always be applied to D for the reasons outlined above
    Last edited by XLent; 03-23-2022 at 05:15 AM. Reason: reworded

+ 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. FILTER With Multiple Partial String Matches
    By helmanfrow in forum Excel General
    Replies: 7
    Last Post: 06-22-2020, 01:41 PM
  2. advanced filter multiple exact matches
    By seraphin in forum Excel General
    Replies: 6
    Last Post: 06-06-2019, 01:46 AM
  3. If function that excludes blank cells
    By Brown97 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-05-2018, 11:23 AM
  4. Replies: 4
    Last Post: 07-25-2017, 12:26 PM
  5. [SOLVED] Fill range of cells based on matches in multiple cells
    By VidOs in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-17-2017, 01:08 PM
  6. Average Formula of Cells Over Certain Value Excludes Blanks
    By larzep in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-16-2012, 08:36 PM
  7. Replies: 4
    Last Post: 04-19-2010, 11:12 PM

Tags for this Thread

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