Filter Function with multiple criteria from dropdown lists

zinah

Active Member
Joined
Nov 28, 2018
Messages
368
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have managed to get the perfect formula to filter the results by specific number of criteria (dropdown lists). However, I need to add another condition, if any of the criteria is "ALL" then count all population and filter the results accordingly. I'm attaching a sample file to show my formula and the dropdown lists.

The formula I used is
Excel Formula:
=IFERROR(FILTER(A:D,($B:$B=$H$3)*($C:$C=$H$2)*($D:$D=$H$4)),"No Data")

And what I need is: if I choose any of "All" in criteria 1, then it will count all Departments and filter the results based on other selected criteria, same thing for criteria 1 and 2, if I choose option "ALL", then count all considering the rest of selected criteria.

Job Req ID
Previous company​
Department​
Country​
JR100​
AAA​
HR​
USA​
Criteria 1​
HR​
JR200​
BBB​
Finance​
Australia
Criteria 2​
AAA​
JR300​
CCC​
Operations​
Australia
Criteria 3​
Belgium​
JR400​
DDD​
IT​
Argentina
JR500​
AAA​
HR​
Belgium
Results​
JR600​
FFF​
Finance​
Canada
JR500​
AAA​
HR​
Belgium​
JR700​
GGG​
IT​
Australia
JR900​
AAA​
HR​
Belgium​
JR800​
HHH​
Operations​
Brazil
JR1700​
AAA​
HR​
Belgium​
JR900​
AAA​
HR​
Belgium
JR2100​
AAA​
HR​
Belgium​
JR1000​
BBB​
Customer Service​
Argentina
JR1100​
CCC​
HR​
USA
JR1200​
DDD​
Finance​
USA
JR1300​
EEE​
Operations​
Australia
JR1400​
FFF​
IT​
Brazil
JR1500​
GGG​
HR​
USA
JR1600​
HHH​
Finance​
Argentina
JR1700​
AAA​
HR​
Belgium
JR1800​
BBB​
Operations​
USA
JR1900​
CCC​
Legal​
Australia
JR2000​
DDD​
Customer Service​
USA
JR2100​
AAA​
HR​
Belgium
JR2200​
BBB​
Finance​
Brazil
JR2300​
CCC​
Operations​
Australia
JR2400​
DDD​
IT​
USA
JR2500​
EEE​
HR​
Austria
JR2600​
FFF​
Finance​
USA
JR2700​
GGG​
IT​
USA
JR2800​
HHH​
Operations​
Austria
JR2900​
AAA​
Legal​
Brazil
JR3000​
BBB​
Customer Service​
USA
JR3100​
CCC​
HR​
Austria
JR3200​
DDD​
Finance​
Canada
JR3300​
EEE​
Operations​
Argentina
JR3400​
FFF​
IT​
Austria
JR3500​
GGG​
HR​
Austria
JR3600​
HHH​
Finance​
Canada
JR3700​
AAA​
HR​
Argentina
JR3800​
BBB​
Finance​
Canada
JR3900​
CCC​
Operations​
Austria
JR4000​
DDD​
IT​
Argentina


Book1
ABCDEFGHIJKLMNOPQRSTUVWX
1Job Req IDPrevious company DepartmentCountryDropdown Lists
2JR100AAAHRUSACriteria 1HRALLALLALL
3JR200BBBFinanceAustraliaCriteria 2AAAHRAAAArgentina
4JR300CCCOperationsAustraliaCriteria 3BelgiumFinanceBBBAustralia
5JR400DDDITArgentinaOperationsCCCAustria
6JR500AAAHRBelgiumResultsITDDDBelgium
7JR600FFFFinanceCanadaJR500AAAHRBelgiumLegalEEEBrazil
8JR700GGGITAustraliaJR900AAAHRBelgiumCustomer ServiceFFFCanada
9JR800HHHOperationsBrazilJR1700AAAHRBelgiumGGGUSA
10JR900AAAHRBelgiumJR2100AAAHRBelgiumHHH
11JR1000BBBCustomer ServiceArgentina
12JR1100CCCHRUSA
13JR1200DDDFinanceUSA
14JR1300EEEOperationsAustralia
15JR1400FFFITBrazil
16JR1500GGGHRUSA
17JR1600HHHFinanceArgentina
18JR1700AAAHRBelgium
19JR1800BBBOperationsUSA
20JR1900CCCLegalAustralia
21JR2000DDDCustomer ServiceUSA
22JR2100AAAHRBelgium
23JR2200BBBFinanceBrazil
24JR2300CCCOperationsAustralia
25JR2400DDDITUSA
26JR2500EEEHRAustria
27JR2600FFFFinanceUSA
28JR2700GGGITUSA
29JR2800HHHOperationsAustria
30JR2900AAALegalBrazil
31JR3000BBBCustomer ServiceUSA
32JR3100CCCHRAustria
33JR3200DDDFinanceCanada
34JR3300EEEOperationsArgentina
35JR3400FFFITAustria
36JR3500GGGHRAustria
37JR3600HHHFinanceCanada
38JR3700AAAHRArgentina
39JR3800BBBFinanceCanada
40JR3900CCCOperationsAustria
41JR4000DDDITArgentina
42
43
44
45
46
47
48
Sheet1
Cell Formulas
RangeFormula
I7:L10I7=IFERROR(FILTER(A:D,($B:$B=$H$3)*($C:$C=$H$2)*($D:$D=$H$4)),"No Data")
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
H2List=$T$2:$T$8
H3List=$V$2:$V$10
H4List=$X$2:$X$9
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
How about
Excel Formula:
=FILTER(A:D,IF(H3="ALL",B:B<>"",$B:$B=H3)*IF(H2="ALL",C:C<>"",$C:$C=$H$2)*IF(H4="ALL",D:D<>"",$D:$D=$H$4),"No Data")
 
Upvote 0
How about
Excel Formula:
=FILTER(A:D,IF(H3="ALL",B:B<>"",$B:$B=H3)*IF(H2="ALL",C:C<>"",$C:$C=$H$2)*IF(H4="ALL",D:D<>"",$D:$D=$H$4),"No Data")
Thank you as usual, but what about if I want to include column 1 (job req) and column 3 (department)?
 
Upvote 0
Not sure what you mean. You're not filtering on the job req.
 
Upvote 0
Ok how about
Excel Formula:
=FILTER(FILTER(A:D,IF(H3="ALL",B:B<>"",$B:$B=H3)*IF(H2="ALL",C:C<>"",$C:$C=$H$2)*IF(H4="ALL",D:D<>"",$D:$D=$H$4),"No Data"),ISODD(COLUMN(A:D)))
 
Upvote 0
Solution
Ok how about
Excel Formula:
=FILTER(FILTER(A:D,IF(H3="ALL",B:B<>"",$B:$B=H3)*IF(H2="ALL",C:C<>"",$C:$C=$H$2)*IF(H4="ALL",D:D<>"",$D:$D=$H$4),"No Data"),ISODD(COLUMN(A:D)))
That's clever solution, I never knew about
Excel Formula:
ISODD
or even
Excel Formula:
ISEVEN
formula. As usual, thank you so much, I really learned a lot from you and the rest of the members here.
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,887
Messages
6,175,199
Members
452,617
Latest member
Narendra Babu D

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top