Filter Function with Multiple Criteria

zinah

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

I have below sample table and what I need to get is the list of employee names that report to the manager table only, I tried to use filter formula(below) but it didn't work. Not sure why I was not able to paste the data using XL2BB. Can anyone suggest a better formula?


Thanks!


Column A Column B Column C Column F
Employee IDEmployee Name
Employee's Manager​
Managers Table​
1​
A​
JJ​
JJ​
2​
B​
KK​
KK​
3​
C​
LL​
LL​
4​
D​
MM​
MM​
5​
E​
NN​
NN​
6​
F​
OO​
OO​
7​
G​
PP​
PP​
Formula​
8​
H​
JJ​
=FILTER($B$2:$B$41,$C$2:$C$41=F2:F8)​
9​
I​
KK​
10​
J​
LL​
11​
K​
MM​
12​
L​
NN​
13​
M​
OO​
14​
N​
PP​
15​
O​
JJ​
16​
P​
KK​
17​
Q​
LL​
18​
R​
MM​
19​
S​
NN​
20​
T​
OO​
21​
U​
PP​
22​
V​
JJ​
23​
X​
KK​
24​
Y​
LL​
25​
Z​
MM​
26​
AA​
NN​
27​
BB​
OO​
28​
CC​
PP​
29​
DD​
JJ​
30​
EE​
KK​
31​
FF​
LL​
32​
KKK​
Y21​
33​
LLL​
Y21​
34​
PPP​
Y21​
35​
UUU​
Y21​
36​
RRR​
Y21​
37​
TTT​
K21​
38​
SSS​
K21​
39​
S21​
K21​
40​
S45​
K21​
 

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.
Book1
ABCDEFGH
1Employee IDEmployee NameEmployee's ManagerManagers TableFormula
21AJJJJA
32BKKKKB
43CLLLLC
54DMMMMD
65ENNNNE
76FOOOOF
87GPPPPG
98HJJH
109IKKI
1110JLLJ
1211KMMK
1312LNNL
1413MOOM
1514NPPN
1615OJJO
1716PKKP
1817QLLQ
1918RMMR
2019SNNS
2120TOOT
2221UPPU
2322VJJV
2423XKKX
2524YLLY
2625ZMMZ
2726AANNAA
2827BBOOBB
2928CCPPCC
3029DDJJDD
3130EEKKEE
3231FFLLFF
3332KKKY21
3433LLLY21
3534PPPY21
3635UUUY21
3736RRRY21
3837TTTK21
3938SSSK21
4039S21K21
4140S45K21
Sheet10
Cell Formulas
RangeFormula
H2:H32H2=FILTER(B2:B41,COUNTIF(F2:F8,C2:C41))
Dynamic array formulas.
 
Upvote 0
Book1
ABCDEFGH
1Employee IDEmployee NameEmployee's ManagerManagers TableFormula
21AJJJJA
32BKKKKB
43CLLLLC
54DMMMMD
65ENNNNE
76FOOOOF
87GPPPPG
98HJJH
109IKKI
1110JLLJ
1211KMMK
1312LNNL
1413MOOM
1514NPPN
1615OJJO
1716PKKP
1817QLLQ
1918RMMR
2019SNNS
2120TOOT
2221UPPU
2322VJJV
2423XKKX
2524YLLY
2625ZMMZ
2726AANNAA
2827BBOOBB
2928CCPPCC
3029DDJJDD
3130EEKKEE
3231FFLLFF
3332KKKY21
3433LLLY21
3534PPPY21
3635UUUY21
3736RRRY21
3837TTTK21
3938SSSK21
4039S21K21
4140S45K21
Sheet10
Cell Formulas
RangeFormula
H2:H32H2=FILTER(B2:B41,COUNTIF(F2:F8,C2:C41))
Dynamic array formulas.
Thank you so much! what about if I add two more criteria, which is count the R from column D and Y from column E?
Column A Column B Column C Column D Column E Column G
Employee IDEmployee Name
Employee's Manager​
Type​
Status​
Managers Table​
1​
A​
JJ​
R​
Y​
JJ​
2​
B​
KK​
R​
Y​
KK​
3​
C​
LL​
R​
Y​
LL​
4​
D​
MM​
R​
N​
MM​
5​
E​
NN​
R​
N​
NN​
6​
F​
OO​
R​
N​
OO​
7​
G​
PP​
R​
N​
PP​
=FILTER(B2:B41,COUNTIFS(G2:G8,C2:C41,D2:D41,"R",E2:E41,"Y"))​
8​
H​
JJ​
R​
N​
#VALUE!​
9​
I​
KK​
R​
N​
10​
J​
LL​
R​
N​
11​
K​
MM​
R​
N​
12​
L​
NN​
R​
N​
13​
M​
OO​
R​
Y​
14​
N​
PP​
R​
Y​
15​
O​
JJ​
R​
Y​
16​
P​
KK​
R​
N​
17​
Q​
LL​
R​
N​
18​
R​
MM​
R​
N​
19​
S​
NN​
R​
N​
20​
T​
OO​
R​
N​
21​
U​
PP​
R​
N​
22​
V​
JJ​
R​
N​
23​
X​
KK​
R​
N​
24​
Y​
LL​
R​
N​
25​
Z​
MM​
R​
Y​
26​
AA​
NN​
R​
Y​
27​
BB​
OO​
R​
Y​
28​
CC​
PP​
R​
N​
29​
DD​
JJ​
R​
N​
30​
EE​
KK​
R​
N​
31​
FF​
LL​
C​
N​
32​
KKK​
Y21​
R​
N​
33​
LLL​
Y21​
R​
N​
34​
PPP​
Y21​
R​
N​
35​
UUU​
Y21​
R​
N​
36​
RRR​
Y21​
R​
N​
37​
TTT​
K21​
C​
Y​
38​
SSS​
K21​
R​
Y​
39​
S21​
K21​
R​
Y​
40​
S45​
K21​
R​
Y​
 
Upvote 0
Hello everyone!

Can anyone help with enhancing the suggested formula to add more criteria to the filter function? The formula I tried using to add 2 more criteria didn't work, not sure what I'm missing:
Here's the formula:
add two more criteria, which is count the R from column D and Y from column E
=FILTER(B2:B41,COUNTIFS(G2:G8,C2:C41,D2:D41,"R",E2:E41,"Y"))
 
Upvote 0
Try

Book5
ABCDEFGHIJKL
1Employee IDEmployee NameEmployee's ManagerTypeStatusManagers TableTypeStatus
21AJJRYJJRYA
32BKKRYKKB
43CLLRYLLC
54DMMRNMMM
65ENNRNNNN
76FOORNOOO
87GPPRNPPZ
98HJJRNAA
109IKKRNBB
1110JLLRN
1211KMMRN
1312LNNRN
1413MOORY
1514NPPRY
1615OJJRY
1716PKKRN
1817QLLRN
1918RMMRN
2019SNNRN
2120TOORN
2221UPPRN
2322VJJRN
2423XKKRN
2524YLLRN
2625ZMMRY
2726AANNRY
2827BBOORY
2928CCPPRN
3029DDJJRN
3130EEKKRN
3231FFLLCN
3332KKKY21RN
3433LLLY21RN
3534PPPY21RN
3635UUUY21RN
3736RRRY21RN
3837TTTK21CY
3938SSSK21RY
4039S21K21RY
4140S45K21RY
42
Sheet3
Cell Formulas
RangeFormula
J2:J10J2=FILTER(B2:B41,ISNUMBER(MATCH(C2:C41,G2:G8,0))*ISNUMBER(MATCH(D2:D41,H2,0))*ISNUMBER(MATCH(E2:E41,I2,0)))
Dynamic array formulas.
 
Upvote 0
Book1
ABCDEFGHI
1mployee IDEmployee NameEmployee's ManagerTypeStatusManagers Table
21AJJRYJJA
32BKKRYKKB
43CLLRYLLC
54DMMRNMMM
65ENNRNNNN
76FOORNOOO
87GPPRNPPZ
98HJJRNAA
109IKKRNBB
1110JLLRN
1211KMMRN
1312LNNRN
1413MOORY
1514NPPRY
1615OJJRY
1716PKKRN
1817QLLRN
1918RMMRN
2019SNNRN
2120TOORN
2221UPPRN
2322VJJRN
2423XKKRN
2524YLLRN
2625ZMMRY
2726AANNRY
2827BBOORY
2928CCPPRN
3029DDJJRN
3130EEKKRN
3231FFLLCN
3332KKKY21RN
3433LLLY21RN
3534PPPY21RN
3635UUUY21RN
3736RRRY21RN
3837TTTK21CY
3938SSSK21RY
4039S21K21RY
4140S45K21RY
Sheet5
Cell Formulas
RangeFormula
I2:I10I2=FILTER(B2:B41,(COUNTIF(G2:G8,C2:C41))*(D2:D41="R")*(E2:E41="Y"))
Dynamic array formulas.
 
Upvote 0
Solution
Try

Book5
ABCDEFGHIJKL
1Employee IDEmployee NameEmployee's ManagerTypeStatusManagers TableTypeStatus
21AJJRYJJRYA
32BKKRYKKB
43CLLRYLLC
54DMMRNMMM
65ENNRNNNN
76FOORNOOO
87GPPRNPPZ
98HJJRNAA
109IKKRNBB
1110JLLRN
1211KMMRN
1312LNNRN
1413MOORY
1514NPPRY
1615OJJRY
1716PKKRN
1817QLLRN
1918RMMRN
2019SNNRN
2120TOORN
2221UPPRN
2322VJJRN
2423XKKRN
2524YLLRN
2625ZMMRY
2726AANNRY
2827BBOORY
2928CCPPRN
3029DDJJRN
3130EEKKRN
3231FFLLCN
3332KKKY21RN
3433LLLY21RN
3534PPPY21RN
3635UUUY21RN
3736RRRY21RN
3837TTTK21CY
3938SSSK21RY
4039S21K21RY
4140S45K21RY
42
Sheet3
Cell Formulas
RangeFormula
J2:J10J2=FILTER(B2:B41,ISNUMBER(MATCH(C2:C41,G2:G8,0))*ISNUMBER(MATCH(D2:D41,H2,0))*ISNUMBER(MATCH(E2:E41,I2,0)))
Dynamic array formulas.
Thank you so much for your help :), your suggested formula worked perfectly fine!
 
Upvote 0
Book1
ABCDEFGHI
1mployee IDEmployee NameEmployee's ManagerTypeStatusManagers Table
21AJJRYJJA
32BKKRYKKB
43CLLRYLLC
54DMMRNMMM
65ENNRNNNN
76FOORNOOO
87GPPRNPPZ
98HJJRNAA
109IKKRNBB
1110JLLRN
1211KMMRN
1312LNNRN
1413MOORY
1514NPPRY
1615OJJRY
1716PKKRN
1817QLLRN
1918RMMRN
2019SNNRN
2120TOORN
2221UPPRN
2322VJJRN
2423XKKRN
2524YLLRN
2625ZMMRY
2726AANNRY
2827BBOORY
2928CCPPRN
3029DDJJRN
3130EEKKRN
3231FFLLCN
3332KKKY21RN
3433LLLY21RN
3534PPPY21RN
3635UUUY21RN
3736RRRY21RN
3837TTTK21CY
3938SSSK21RY
4039S21K21RY
4140S45K21RY
Sheet5
Cell Formulas
RangeFormula
I2:I10I2=FILTER(B2:B41,(COUNTIF(G2:G8,C2:C41))*(D2:D41="R")*(E2:E41="Y"))
Dynamic array formulas.
Thank you so much for your help, your formula helped me understand what was missing in my formula and it worked perfectly great :)
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,177
Members
452,615
Latest member
bogeys2birdies

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