Find number of times a value is true in column B OR C for a given value in column A (likely Countif or Sumproduct)

Kotetsu534

New Member
Joined
Mar 6, 2022
Messages
2
Office Version
  1. 365
  2. 2003 or older
Platform
  1. Web
I am quite new at using Excel formulas, and wonder if there's a way I can extract what I want from a table like below:

TeamAchievement 1Achievement 2
AYesYes
BYesYes
CNoNo
ANoYes
CYesYes

I'd like to be able to add a column to another sheet which searches for a particular "Team" in the first column, then searches for whether there's a Yes in *either* "Achievement 1" or "Achievement 2" (so just using Countifs won't work - it would double count if both columns have a "Yes") then totals the number of rows in which that's true. So for Team A, my column would return 2, for Team B, it would return 1, and for Team C, it would also return 1.

Would really appreciate any help and sorry if this is a very basic question - I couldn't find an example after some googling so came here.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Using a helper column.

Book1.xlsb
ABCDEFG
1TeamAchievement 1Achievement 2HelperTeamTotal
2AYesYes1A2
3BYesYes1B1
4CNoNo0C1
5ANoYes1
6CYesYes1
Sheet3
Cell Formulas
RangeFormula
F2:F4F2=SORT(UNIQUE(A2:A6))
G2:G4G2=SUMIF($A$2:$A$6,F2,$D$2:$D$6)
D2:D6D2=OR(B2="Yes",C2="Yes")+0
Dynamic array formulas.
 
Upvote 0
Hi & welcome to Mr Excel.
Another option
+Fluff 1.xlsm
ABCDEF
1TeamAchievement 1Achievement 2TeamTotal
2AYesYesA2
3BYesYesB1
4CNoNoC1
5ANoYes
6CYesYes
7
Data
Cell Formulas
RangeFormula
F2:F4F2=SUMPRODUCT(($A$2:$A$6=E2)*((($B$2:$B$6="Yes")+($C$2:$C$6="yes"))>0))
 
Upvote 0
Solution
Hi,

Another way:

Use D2 formula will replicate results
Use E2 formula will only populate 1st instance.

Book3.xlsx
ABCDE
1TeamAchievement 1Achievement 2
2AYesYes22
3BYesYes11
4CNoNo11
5ANoYes2 
6CYesYes1 
Sheet1042
Cell Formulas
RangeFormula
D2:D6D2=SUMPRODUCT((A$2:A$6=A2)*ISNUMBER(SEARCH("Yes",B$2:B$6&C$2:C$6)))
E2:E6E2=IF(COUNTIF(A$2:A2,A2)=1,SUMPRODUCT((A$2:A$6=A2)*ISNUMBER(SEARCH("Yes",B$2:B$6&C$2:C$6))),"")
 
Upvote 0
Was trying to figure one out without the helper too. I like Fluff's, pretty straight forward.

Book1.xlsb
ABCDEF
1TeamAchievement 1Achievement 2TeamTotal
2AYesYesA2
3BYesYesB1
4CNoNoC1
5ANoYes
6CYesYes
Sheet3
Cell Formulas
RangeFormula
E2:E4E2=SORT(UNIQUE(A2:A6))
F2:F4F2=SUMPRODUCT(($A$2:$A$6=E2)*IFERROR((($B$2:$B$6="Yes")+($C$2:$C$6="Yes"))^0,0))
Dynamic array formulas.
 
Upvote 0
Thanks very much everyone for your swift responses - especially Fluff's method which I've just implemented and works well. I understood the logic at work too - pretty intuitive.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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