COUNTA with conditions

willow1985

Well-known Member
Joined
Jul 24, 2019
Messages
888
Office Version
  1. 365
Platform
  1. Windows
I am trying to write a complicated formula with countif and count A. Basically my goal is when M1 has the value "All" that all "Y" and "N" are counted.
However if M1 has the person's name it will only count the "Y" and "N" for that person. My end goal is to graph this so I can rather show everyone's "Y" and "N" result or by the individual person when you select specified values in M1.

Help would be greatly appreciated!

Safety Incentive.xlsx
ABCDEFGHIJKLM
1YNWilliam
2Emp NamePPESafe LiftingSafety KnowledgeSafety TrainingSWPUnsafe Acts 11
3WilliamYNYYYNAshley66
4SteveYYYYYNSteve66
5AshleyYYYNYNTest66
6TestYYYNYNTest 266
7Test 2YNYYYNWilliam66
8
Sheet1
Cell Formulas
RangeFormula
J2:J7J2=IFERROR(IF(AND($M$1="All",$I$2="All"),COUNTIF(Table1[[PPE]:[Unsafe Acts]],$J$1),COUNTA(INDEX(Table1[[PPE]:[Unsafe Acts]],MATCH(I2,Table1[Emp Name],0),0))),"0")
K2:K7K2=IFERROR(IF(AND($M$1="All",$I$2="All"),COUNTIF(Table1[[PPE]:[Unsafe Acts]],$K$1),COUNTA(INDEX(Table1[[PPE]:[Unsafe Acts]],MATCH(I2,Table1[Emp Name],0),0))),"0")
I2I2=IF(M1="All","All","")
I3:I7I3=IF(M1="All","",UNIQUE(SORT(Table1[Emp Name])))
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
B3:G7ListY,N


1644868793255.png
 

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.

Forum statistics

Threads
1,214,913
Messages
6,122,207
Members
449,074
Latest member
cancansova

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