AndroidClone
New Member
- Joined
- Jun 29, 2018
- Messages
- 2
Hi guys, very long time lurker but first-time poster. I am wondering if anyone could help me clean up this array formula. I need to be able to count all instances of 0,1,2 except for [0,0],[0,1],[1,0],[1,1]. Please forgive my quick and dirty formula (not safe for looking). It is working as intended but is not user-friendly at all. I just added the + operator and copied in my original array for all of the other possible combinations that you can see on my pivot table (highlighted in yellow)
B2 = Country
BQ:BQ = P1 Country list
BG:BG = pass/fail left
BH:BH = pass/fail right
pass = 1
fail = 2
blank = 0
=SUM(IF((B2='P1 EXPORT'!$BQ$2:$BQ$1769)*('P1 EXPORT'!$BG$2:$BG$1769=2)*('P1 EXPORT'!BH2:$BH$1769=2),1/COUNTIFS('P1 EXPORT'!$BQ$2:$BQ$1769,B2,'P1 EXPORT'!$A$2:$A$1769,'P1 EXPORT'!$A$2:$A$1769,'P1 EXPORT'!$BG$2:$BG$1769,2,'P1 EXPORT'!$BH$2:$BH$1769,2)),0)+SUM(IF((B2='P1 EXPORT'!$BQ$2:$BQ$1769)*('P1 EXPORT'!$BG$2:$BG$1769=1)*('P1 EXPORT'!BH2:$BH$1769=2),1/COUNTIFS('P1 EXPORT'!$BQ$2:$BQ$1769,B2,'P1 EXPORT'!$A$2:$A$1769,'P1 EXPORT'!$A$2:$A$1769,'P1 EXPORT'!$BG$2:$BG$1769,1,'P1 EXPORT'!$BH$2:$BH$1769,2)),0)+SUM(IF((B2='P1 EXPORT'!$BQ$2:$BQ$1769)*('P1 EXPORT'!$BG$2:$BG$1769=0)*('P1 EXPORT'!BH2:$BH$1769=2),1/COUNTIFS('P1 EXPORT'!$BQ$2:$BQ$1769,B2,'P1 EXPORT'!$A$2:$A$1769,'P1 EXPORT'!$A$2:$A$1769,'P1 EXPORT'!$BG$2:$BG$1769,0,'P1 EXPORT'!$BH$2:$BH$1769,2)),0)+SUM(IF((B2='P1 EXPORT'!$BQ$2:$BQ$1769)*('P1 EXPORT'!$BG$2:$BG$1769=2)*('P1 EXPORT'!BH2:$BH$1769=1),1/COUNTIFS('P1 EXPORT'!$BQ$2:$BQ$1769,B2,'P1 EXPORT'!$A$2:$A$1769,'P1 EXPORT'!$A$2:$A$1769,'P1 EXPORT'!$BG$2:$BG$1769,2,'P1 EXPORT'!$BH$2:$BH$1769,1)),0)+SUM(IF((B2='P1 EXPORT'!$BQ$2:$BQ$1769)*('P1 EXPORT'!$BG$2:$BG$1769=2)*('P1 EXPORT'!BH2:$BH$1769=0),1/COUNTIFS('P1 EXPORT'!$BQ$2:$BQ$1769,B2,'P1 EXPORT'!$A$2:$A$1769,'P1 EXPORT'!$A$2:$A$1769,'P1 EXPORT'!$BG$2:$BG$1769,2,'P1 EXPORT'!$BH$2:$BH$1769,0)),0)
B2 = Country
BQ:BQ = P1 Country list
BG:BG = pass/fail left
BH:BH = pass/fail right
pass = 1
fail = 2
blank = 0
=SUM(IF((B2='P1 EXPORT'!$BQ$2:$BQ$1769)*('P1 EXPORT'!$BG$2:$BG$1769=2)*('P1 EXPORT'!BH2:$BH$1769=2),1/COUNTIFS('P1 EXPORT'!$BQ$2:$BQ$1769,B2,'P1 EXPORT'!$A$2:$A$1769,'P1 EXPORT'!$A$2:$A$1769,'P1 EXPORT'!$BG$2:$BG$1769,2,'P1 EXPORT'!$BH$2:$BH$1769,2)),0)+SUM(IF((B2='P1 EXPORT'!$BQ$2:$BQ$1769)*('P1 EXPORT'!$BG$2:$BG$1769=1)*('P1 EXPORT'!BH2:$BH$1769=2),1/COUNTIFS('P1 EXPORT'!$BQ$2:$BQ$1769,B2,'P1 EXPORT'!$A$2:$A$1769,'P1 EXPORT'!$A$2:$A$1769,'P1 EXPORT'!$BG$2:$BG$1769,1,'P1 EXPORT'!$BH$2:$BH$1769,2)),0)+SUM(IF((B2='P1 EXPORT'!$BQ$2:$BQ$1769)*('P1 EXPORT'!$BG$2:$BG$1769=0)*('P1 EXPORT'!BH2:$BH$1769=2),1/COUNTIFS('P1 EXPORT'!$BQ$2:$BQ$1769,B2,'P1 EXPORT'!$A$2:$A$1769,'P1 EXPORT'!$A$2:$A$1769,'P1 EXPORT'!$BG$2:$BG$1769,0,'P1 EXPORT'!$BH$2:$BH$1769,2)),0)+SUM(IF((B2='P1 EXPORT'!$BQ$2:$BQ$1769)*('P1 EXPORT'!$BG$2:$BG$1769=2)*('P1 EXPORT'!BH2:$BH$1769=1),1/COUNTIFS('P1 EXPORT'!$BQ$2:$BQ$1769,B2,'P1 EXPORT'!$A$2:$A$1769,'P1 EXPORT'!$A$2:$A$1769,'P1 EXPORT'!$BG$2:$BG$1769,2,'P1 EXPORT'!$BH$2:$BH$1769,1)),0)+SUM(IF((B2='P1 EXPORT'!$BQ$2:$BQ$1769)*('P1 EXPORT'!$BG$2:$BG$1769=2)*('P1 EXPORT'!BH2:$BH$1769=0),1/COUNTIFS('P1 EXPORT'!$BQ$2:$BQ$1769,B2,'P1 EXPORT'!$A$2:$A$1769,'P1 EXPORT'!$A$2:$A$1769,'P1 EXPORT'!$BG$2:$BG$1769,2,'P1 EXPORT'!$BH$2:$BH$1769,0)),0)