I am trying to create a query that populates information based on the user's selected drop downs. Query is all built and functional, and populates the items in the master data that match the selected drop down items (i.e. if dropdown A = Canada, B = Car, and C = Red it will populate all dealerships in Canada that are selling red cars.
My problem is that sometimes the "dealerships" are selling cars of all colors. Instead of entering each color individually into separate lines of the master sheet, I want my query to populate both the data matching the selected color AND anything that says "all". These are figurative scenarios as it's sensitive data, but here's what I have so far.
=QUERY(Master!B4:F,"SELECT * WHERE 1=1 "&IF(B4="All Regions",""," AND LOWER(C) = LOWER('"&B4&"') ")&IF(C4="All Vehicles",""," AND LOWER(D) = LOWER('"&C4&"') ")&IF(D4="All Colors",""," AND LOWER(E) = LOWER('"&D4&"') "),1)
I feel like I should be able to add something into the IF functions that will tell my sheet to populate data that has text that says "all" and whatever is in the dropdown cell... but I can't for the life of me get it to work.