+ Reply to Thread
Results 1 to 11 of 11

Advanced Filter using "OR" for all 12 possibilities

  1. #1
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Advanced Filter using "OR" for all 12 possibilities

    I'm pretty good with Advanced Filters but I need them to be simpler in this case.

    See the attached, where I've kept golf group foursomes log for many rounds of golf. I'd like to filter the left table for anyone named "Jim" and can do that with 4 rows of criteria. When it comes to Two different players it takes me 12 rows of criteria. I think this needs to be Combination of 4 things taken 2 at a time. The grey area is my criteria for the filter.
    Advanced Filter Or Question.xlsm
    The idea is to get all matches in the first/left table when either of the two players were in the same foursome.

    I'd love a hint or two to simplify this filter and not need 12 rows to do it.
    Last edited by MarvinP; 05-21-2022 at 12:05 PM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Advanced Filter using "OR" for all 12 possibilities

    I don't think you can easily achieve this with Advanced Filter, but as you are now using Office 365 why not use FILTER function?

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

    (in US version of excel change semicolons to comas as argument separators or just open the file and see how your excel reads the formula)

    Moreover try to look for triples, not pairs with advanced filter :-D while with such formula you just add third segment:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Of course a simple concept could de to use a helper column with check whether both names appeared in given row, and then use it for filter (with just one criterion) .
    But you probably would like not to use the helper column,.
    But this approach could be easily implemented with Power Query to keep a "neat design" of the worksheet.


    A final comment: you have two Rons in data so both
    Ron Zehnder Stan Blaske
    and
    Ron Arnold Stan Blaske
    pairs are listed

    May be it wopuld be wise to use first and family names in search
    Attached Files Attached Files
    Last edited by Kaper; 05-21-2022 at 04:01 AM.
    Best Regards,

    Kaper

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Advanced Filter using "OR" for all 12 possibilities

    PS. I did also the PQ approach. The only non-standard part is the use of 2 named ranges with 2 names FirstPlayer and SecondPlayer to use them as parameters for the query:
    So I manually added these two lines:
    Please Login or Register  to view this content.
    just after creating a "query based on range or table" when it contained only source and Changed Type lines. After addint=g the two above listed in line below Source, did all the rest in PQ editor.

    The resulting code of the query:
    Please Login or Register  to view this content.
    again - see the attachment.
    Last edited by Kaper; 05-21-2022 at 04:56 AM.

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Advanced Filter using "OR" for all 12 possibilities

    Please try

    =LET(z,A2:D633,s,F2:G2,n,COLUMNS(s),b,INDEX(z,,1)&INDEX(z,,2)&INDEX(z,,3)&INDEX(z,,4),FILTER(z,MMULT(--ISNUMBER(SEARCH(s,b)),SEQUENCE(n,,,0))=n))
    Attached Files Attached Files

  5. #5
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,416

    Re: Advanced Filter using "OR" for all 12 possibilities

    Cell F16 formula

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

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Advanced Filter using "OR" for all 12 possibilities

    Hi Bo_Ry,

    I'll need to follow your "LET" answer in a few days. I believe it is correct but don't know if my end-user has that function yet.

  7. #7
    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,821

    Re: Advanced Filter using "OR" for all 12 possibilities

    Hi, Marvin!

    What about the other two contributors?
    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.

  8. #8
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Advanced Filter using "OR" for all 12 possibilities

    Hi wk9128,

    I ended up using Kaper's answer but expanded it to 4 possible players and added a date and course columns also. I'll need to see why the "N(ISNUMBER(" is needed. Also the test names of "Ron" and "Stan" will change based on an input value but I think you knew that.

  9. #9
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,416

    Re: Advanced Filter using "OR" for all 12 possibilities

    @MarvinP Glad to help . Thank You for the feedback

    {"Ron" and "Stan" will change }

    It turned out to be the case, I thought the name was fixed, misunderstood what you meant

  10. #10
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Advanced Filter using "OR" for all 12 possibilities

    Hey Bo_Ry,

    I've finally got a chance to use your spectacular LET formula above and find it much easier than all others. You are a formula star in my book.
    Thanks again.

  11. #11
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Advanced Filter using "OR" for all 12 possibilities

    Hey Ali,

    After a few extra days trying to get Kaper's formula to work on my larger dataset, I went back and tried Bo_Ry's formula. I'm almost ready to pay him for making the problem easier.
    Thanks for the reminder to circle back around.

+ 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. Replies: 7
    Last Post: 03-17-2014, 01:51 PM
  2. advanced filter criteria "begins with" and "does not begin with"
    By Eddie O in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-06-2005, 12:05 PM
  3. "Criteria Range" in the "Data/Filter/Advanced Filter" to select Du
    By TC in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-11-2005, 10:06 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