Share via

Filter formula with multiple lookups over multiple columns

Laura Walker 0 Reputation points
2026-03-12T20:10:51.94+00:00

I'm trying to use the FILTER function formula to list a consolidated view of lease agreements, by office locations, to separate out the different leases by location instead of all the leases being shown under just the Data | Filter option on the sheet. I want to show my Expense Leases, separated out from Parking Leases and Storage Leases. I'm trying to show this by the filter formula with a lookup type of Record Status (Active, Indefinite, M-T-M, and Pending), by Record Type (Expense - Lease, Income - Lease, Expense - Owned) and by SubType (Office, E-Suite, Parking, and Storage).

Sheet1 has a condensed view of what I'm trying to show. Sheet2 has all the data information.

This is the formula that I'm using, but it's returning all documents instead of the ones that would match by city name lookup value.

=IFERROR(FILTER(Sheet2!A12:U1159,((Sheet2!F12:F1159=B1)+(Sheet2!N12:N1159="Expense - Lease")+(Sheet2!N12:N1159="Expense - Owned"))*(Sheet2!O12:O1159="Office")+(Sheet2!O12:O1159="E-Suite")),"No Record Found").Can you help solve this mystery for me. Thank you for your time time.

Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments
{count} votes

Answer accepted by question author
  1. Q&A Assist
    2026-03-12T20:11:05.5666667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The FILTER formula is returning all rows because of how the Boolean logic is combined. In Excel, + acts like OR and * acts like AND when used with Boolean arrays, and operator precedence plus missing parentheses are causing the criteria to evaluate much more broadly than intended.

    To filter by:

    • City in Sheet2!F:F matching B1
    • Record Type in Sheet2!N:N being either "Expense - Lease" or "Expense - Owned"
    • SubType in Sheet2!O:O being either "Office" or "E-Suite"

    use a FILTER formula that groups the OR conditions inside parentheses and ANDs them together:

    =IFERROR(
      FILTER(
        Sheet2!A12:U1159,
        (Sheet2!F12:F1159=B1) *
        ((Sheet2!N12:N1159="Expense - Lease") + (Sheet2!N12:N1159="Expense - Owned")) *
        ((Sheet2!O12:O1159="Office") + (Sheet2!O12:O1159="E-Suite"))
      ),
      "No Record Found"
    )
    

    Explanation of the logic:

    • (Sheet2!F12:F1159=B1) → city must match B1.
    • ((Sheet2!N12:N1159="Expense - Lease") + (Sheet2!N12:N1159="Expense - Owned")) → Record Type is either "Expense - Lease" OR "Expense - Owned".
    • ((Sheet2!O12:O1159="Office") + (Sheet2!O12:O1159="E-Suite")) → SubType is either "Office" OR "E-Suite".
    • The * between these grouped conditions means all three groups must be TRUE for a row to be included.

    This structure prevents rows that only match one of the criteria from being included and should stop all documents from being returned.


    References:

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.