Results 1 to 16 of 16

A doosy- Complex logic for filtering - Can you figure it out?

Threaded View

  1. #1
    Registered User
    Join Date
    10-19-2017
    Location
    Mississippi
    MS-Off Ver
    2021
    Posts
    19

    A doosy- Complex logic for filtering - Can you figure it out?

    I have been trying to figure this out for days, but I just cannot get everything to work. I can get some scenarios to work, but not all at the same time. It is very bazaar and frustrating. Even ChatGPT can't get it right.

    Please download and look at the workbook in the attached zip file. It will make what is needed much easier to understand.

    Setup:
    • I have a worksheet called "Libraries" with a listing of sample libraries, with columns for (A)Vendor, (B)Library Name, (C)Library Subgroup, and (D)Patch Name.
    • I have a "Report" worksheet where I am doing filtering on the data in the Libraries sheet.
    • Ok, on the Report sheet I have 3 cells, C11 to E11 which are for inputting text to filter by. C11 filters over column Libraries!B, D11 over Libraries!C, and E11 over Libraries!D. The filter restricts the result listing more as more of cells C11 to E11 get text to filter on, as in the resulting list has to contain only records from Libraries that match all of the specified text as per the corresponding column. I hope that makes sense.
    • Also on the Report sheet is cell C13 which is for specifying filter text which should be a match if ANY of the 3 columns in Libraries contains the specified text.
    • Finally on the Results sheet is the cell (C17) containing the filter formula, which becomes the first row of a column of the resulting filtered list. There are other columns that are similar but for simplicity just focus on getting C17 to work putting correct results in that column. Also, ignore the other text cells on the Report sheet.

    This formula below (in cell C17) seems to work for every scenario of these inputs except when there is text only in C13, in which case it is like that text is ignored - I basically just get as the result the entire list as if no filter text has been specified.
    But if I change the '+' before the IF to a '*', then the lone text in cell C13 works, but other scenarios do not.

    The formula I have now:

    =IFERROR(
    FILTER(
    Libraries!B2:B500000,
    (
    ( ISNUMBER(SEARCH(LOWER(Report!C11), LOWER(Libraries!B2:B500000))) *
    ISNUMBER(SEARCH(LOWER(Report!D11), LOWER(Libraries!C2:C500000))) *
    ISNUMBER(SEARCH(LOWER(Report!E11), LOWER(Libraries!D2:D500000))) )
    +
    IF(Report!C13<>"",
    ( ISNUMBER(SEARCH(LOWER(Report!C13), LOWER(Libraries!B2:B500000))) +
    ISNUMBER(SEARCH(LOWER(Report!C13), LOWER(Libraries!C2:C500000))) +
    ISNUMBER(SEARCH(LOWER(Report!C13), LOWER(Libraries!D2:D500000))) ) )
    ) > 0

    ),
    ""
    )

    If you can solve it you will be forever known as a genius.
    PLEASE SOLVE IT!
    Thanks.
    Attached Files Attached Files
    Last edited by lahatte; 09-20-2023 at 12:38 AM. Reason: Post smaller file

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Count smallest two against a figure in another column and use logic to get true or false
    By MD PERVEZ KHAN in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-20-2015, 06:54 AM
  2. [SOLVED] Filtering Logic - Consider Entire Dataset While Filtering
    By mikegs1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-29-2014, 05:01 PM
  3. Complex If Logic (for me at least!)
    By cschmid1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-08-2012, 02:40 AM
  4. Complex IF AND Logic Help Needed!
    By FatsOnline in forum Excel General
    Replies: 6
    Last Post: 06-20-2012, 02:02 AM
  5. Match Help... A Doosy
    By chrisfreeman in forum Excel General
    Replies: 4
    Last Post: 03-23-2012, 02:25 PM
  6. rather complex logic statement
    By [email protected] in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-31-2006, 03:40 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