FILTER with Criteria

kumara_faith

Well-known Member
Joined
Aug 19, 2006
Messages
928
Office Version
  1. 365
Hi,

I have the following :

Book1
CDE
2Table 1
3RankCategoryKPI
4ManagerSales1500
5ManagerSales2200
6ManagerSales3300
7ManagerSales4500
8ManagerM1
9ManagerM2
10Asst ManagerSales1500
11Asst ManagerSales2200
12Asst ManagerT1
13Asst ManagerT2
14Asst ManagerSales5200
15Asst ManagerSales6600
16Sewnior ExecutiveSales1500
17Sewnior ExecutiveSales2200
18Sewnior ExecutiveQ1
19Sewnior ExecutiveQ2
20Sewnior ExecutiveSales5200
21Sewnior ExecutiveSales6600
Sheet1


Book1
IJKL
2Table 2
3RankBranchCategoryKPI
4ManagerBranch1M110
5ManagerBranch2M1200
6ManagerBranch3M1500
7ManagerBranch4M1300
8ManagerBranch1M2100
9ManagerBranch2M2800
10ManagerBranch3M2400
11ManagerBranch4M2200
12Asst ManagerBranch1T110
13Asst ManagerBranch2T1200
14Asst ManagerBranch3T1500
15Asst ManagerBranch4T1300
16Asst ManagerBranch1T2100
17Asst ManagerBranch2T2800
18Asst ManagerBranch3T2400
19Asst ManagerBranch4T2200
20Sewnior ExecutiveBranch1Q1100
21Sewnior ExecutiveBranch2Q1800
22Sewnior ExecutiveBranch3Q1400
23Sewnior ExecutiveBranch4Q1350
24Sewnior ExecutiveBranch1Q210
25Sewnior ExecutiveBranch2Q2500
26Sewnior ExecutiveBranch3Q2200
27Sewnior ExecutiveBranch4Q2300
Sheet1


Book1
OPQ
2Table 3
3RankManager
4BranchBranch1
5ManagerSales1500
6ManagerSales2200
7ManagerSales3300
8ManagerSales4500
9ManagerM10
10ManagerM20
Sheet1 (2)
Cell Formulas
RangeFormula
O5:Q10O5=FILTER(C4:E21,C4:C21=P3)
Dynamic array formulas.


In Table 1, I have the KPI for all ranks of staffs. In Table 2, I have the KPI for all staff ranks for those KPI which are blank in Table 1. In Table 3, I am trying to auto populate the KPI based on the rank and branch and KPI in Table 1 and the remaining KPI in Table 2.. I managed to populate the first set of information from Table 1 but I am not sure how to populate the information from Table 2. An example of the correct result for Manager will be as follows:

Book1
OPQ
2Table 3
3RankManager
4BranchBranch1
5ManagerSales1500
6ManagerSales2200
7ManagerSales3300
8ManagerSales4500
9ManagerM110
10ManagerM2100
Sheet1


Appreciate any help how to accomplish this. 🙏
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
SOmeone can probably come up with something shorter, but this works:

Book1
ABCDEFGHIJKL
1Table 1Table 2Table 3
2RankCategoryKPIRankBranchCategoryKPIRankManager
3ManagerSales1500ManagerBranch1M110BranchBranch1
4ManagerSales2200ManagerBranch2M1200ManagerSales1500
5ManagerSales3300ManagerBranch3M1500ManagerSales2200
6ManagerSales4500ManagerBranch4M1300ManagerSales3300
7ManagerM1ManagerBranch1M2100ManagerSales4500
8ManagerM2ManagerBranch2M2800ManagerM110
9Asst ManagerSales1500ManagerBranch3M2400ManagerM2100
10Asst ManagerSales2200ManagerBranch4M2200
11Asst ManagerT1Asst ManagerBranch1T110
12Asst ManagerT2Asst ManagerBranch2T1200
13Asst ManagerSales5200Asst ManagerBranch3T1500
14Asst ManagerSales6600Asst ManagerBranch4T1300
15Sewnior ExecutiveSales1500Asst ManagerBranch1T2100
16Sewnior ExecutiveSales2200Asst ManagerBranch2T2800
17Sewnior ExecutiveQ1Asst ManagerBranch3T2400
18Sewnior ExecutiveQ2Asst ManagerBranch4T2200
19Sewnior ExecutiveSales5200Sewnior ExecutiveBranch1Q1100
20Sewnior ExecutiveSales6600Sewnior ExecutiveBranch2Q1800
21Sewnior ExecutiveBranch3Q1400
22Sewnior ExecutiveBranch4Q1350
23Sewnior ExecutiveBranch1Q210
24Sewnior ExecutiveBranch2Q2500
25Sewnior ExecutiveBranch3Q2200
26Sewnior ExecutiveBranch4Q2300
Sheet6
Cell Formulas
RangeFormula
J4:L9J4=FILTER(HSTACK(A3:B20,BYROW(A3:C20,LAMBDA(x,IF(DROP(x,,2)<>"",DROP(x,,2),SUMIFS(H3:H26,F3:F26,K3,E3:E26,TAKE(x,,1),G3:G26,INDEX(x,,2)))))),A3:A20=K2)
Dynamic array formulas.
 
Upvote 0
Another option
Fluff.xlsm
CDEFGHIJKLMNOPQ
1
2Table 1Table 2Table 3
3RankCategoryKPIRankBranchCategoryKPIRankManager
4ManagerSales1500ManagerBranch1M110BranchBranch1
5ManagerSales2200ManagerBranch2M1200ManagerSales1500
6ManagerSales3300ManagerBranch3M1500ManagerSales2200
7ManagerSales4500ManagerBranch4M1300ManagerSales3300
8ManagerM1ManagerBranch1M2100ManagerSales4500
9ManagerM2ManagerBranch2M2800ManagerM110
10Asst ManagerSales1500ManagerBranch3M2400ManagerM2100
11Asst ManagerSales2200ManagerBranch4M2200
12Asst ManagerT1Asst ManagerBranch1T110
13Asst ManagerT2Asst ManagerBranch2T1200
14Asst ManagerSales5200Asst ManagerBranch3T1500
15Asst ManagerSales6600Asst ManagerBranch4T1300
16Sewnior ExecutiveSales1500Asst ManagerBranch1T2100
17Sewnior ExecutiveSales2200Asst ManagerBranch2T2800
18Sewnior ExecutiveQ1Asst ManagerBranch3T2400
19Sewnior ExecutiveQ2Asst ManagerBranch4T2200
20Sewnior ExecutiveSales5200Sewnior ExecutiveBranch1Q1100
21Sewnior ExecutiveSales6600Sewnior ExecutiveBranch2Q1800
22Sewnior ExecutiveBranch3Q1400
23Sewnior ExecutiveBranch4Q1350
24Sewnior ExecutiveBranch1Q210
25Sewnior ExecutiveBranch2Q2500
26Sewnior ExecutiveBranch3Q2200
27Sewnior ExecutiveBranch4Q2300
Main
Cell Formulas
RangeFormula
O5:Q10O5=LET(f,FILTER(C4:E21,C4:C21=P3),IF(f="",SUMIFS(L:L,I:I,P3,J:J,P4,K:K,INDEX(f,,2)),f))
Dynamic array formulas.
 
Upvote 0
Solution
Hi Fluff and JvDv,

Thank you for the solution and appreciate it. Have a great day ahead.🙏
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,216,119
Messages
6,128,946
Members
449,480
Latest member
yesitisasport

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