Countif Table

Alphacsulb

Active Member
Joined
Mar 20, 2008
Messages
414
Hello, I have a reception Im going to be keeping track of those people who arrive and I need 2 formulas to keep track of how many group of people have arrived, and of those how many of them are getting an award.

I'm not sure how to attach my spreadsheet anymore since I've gone to Excel 2016 so hopefully this show up correctly. Below is the desired result. Thank you for the leads. :eek:

DATA

ArrivedNameGroupAward
XLisaSoccer
XBobBaseballYes
RobertBaseball
MikeGolf
XBenSoccerYes
XScottSoccerYes
XDaveGolfYes
DanSoccer
XPatBaseball
XKyleGolfYes

<tbody>
</tbody>


DESIRED RESULT:

Summary: Arrived Arrived and Award
Baseball21
Golf22
Soccer32

<tbody>
</tbody>
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Try this
<table valign="top" border="1"><caption>LEGO HTML</caption><col width="54"><col width="124"><col width="124"><col width="124">
<tr><td></td><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">A</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">B</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">C</font></th></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">1</font></th><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Arrived</font></td><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Name</font></td><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Group</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">2</font></th><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">X</font></td><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Lisa</font></td><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Soccer</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">3</font></th><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">X</font></td><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Bob</font></td><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Baseball</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">4</font></th><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)"></font></td><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Robert</font></td><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Baseball</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">5</font></th><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)"></font></td><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Mike</font></td><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Golf</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">6</font></th><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">X</font></td><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Ben</font></td><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Soccer</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">7</font></th><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">X</font></td><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Scott</font></td><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Soccer</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">8</font></th><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">X</font></td><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Dave</font></td><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Golf</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">9</font></th><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)"></font></td><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Dan</font></td><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Soccer</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">10</font></th><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">X</font></td><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Pat</font></td><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Baseball</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">11</font></th><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">X</font></td><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Kyle</font></td><td style="background-color:rgb(250, 250, 250)"><font face="Verdana" style="color:rgb(51, 51, 51)">Golf</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">12</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">13</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">14</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)"></font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">15</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Summary</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Arrived</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Arrived And Award</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">16</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Baseball</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">1</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">17</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Golf</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">2</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">2</font></td></tr>
<tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">18</font></th><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">Soccer</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">3</font></td><td style="background-color:rgb(255, 255, 255)"><font face="Calibri" style="color:rgb(0, 0, 0)">2</font></td></tr></table><table style="width:100%" valign="top" border="1"><caption>Worksheet Formulas</caption><tr><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">Cell</font></th><th style="background-color:rgb(166, 166, 166)"><font style="color:rgb(0, 0, 0)">Formula</font></th></tr><tr><th style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">B16</font></th></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">=COUNTIFS($A$2:$A$11,"X",$C$2:$C$11,A16)</font></td></tr><tr><th style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">C16</font></th></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">=COUNTIFS($A$2:$A$11,"X",$D$2:$D$11,"Yes",$C$2:$C$11,A16)</font></td></tr><tr><th style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">B17</font></th></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">=COUNTIFS($A$2:$A$11,"X",$C$2:$C$11,A17)</font></td></tr><tr><th style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">C17</font></th></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">=COUNTIFS($A$2:$A$11,"X",$D$2:$D$11,"Yes",$C$2:$C$11,A17)</font></td></tr><tr><th style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">B18</font></th></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">=COUNTIFS($A$2:$A$11,"X",$C$2:$C$11,A18)</font></td></tr><tr><th style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">C18</font></th></td><td style="background-color:rgb(255, 255, 255)"><font style="color:rgb(0, 0, 0)">=COUNTIFS($A$2:$A$11,"X",$D$2:$D$11,"Yes",$C$2:$C$11,A18)</font></td></tr></table>
 
Upvote 0
Try


A
B
C
D
E
F
G
H
1
Arrived​
Name​
Group​
Award​
Summary:​
Arrived​
Arrived and Award​
2
X​
Lisa​
Soccer​
Baseball​
2​
1​
3
X​
Bob​
Baseball​
Yes​
Golf​
2​
2​
4
Robert​
Baseball​
Soccer​
3​
2​
5
Mike​
Golf​
6
X​
Ben​
Soccer​
Yes​
7
X​
Scott​
Soccer​
Yes​
8
X​
Dave​
Golf​
Yes​
9
Dan​
Soccer​
10
X​
Pat​
Baseball​
11
X​
Kyle​
Golf​
Yes​
12

Formula in G2 copied down
=COUNTIFS(C$2:C$11,F2,A$2:A$11,"x")

Formula in H2 copied down
=COUNTIFS($C$2:$C$11,$F2,$A$2:$A$11,"x",D$2:D$11,"Yes")

M.
 
Upvote 0

ABCDEFGH
1ArrivedNameGroupAwardSummary:ArrivedArrived and Award
2XLisaSoccerBaseball
2​
1​
3XBobBaseballYesGolf
2​
2​
4RobertBaseballSoccer
3​
2​
5MikeGolf
6XBenSoccerYes
7XScottSoccerYes
8XDaveGolfYes
9DanSoccer
10XPatBaseball
11XKyleGolfYes


Cell G2
=COUNTIFS(A:A,"X",C:C,F2)

Cell H2
=COUNTIFS(A:A,"X",C:C,F2,D:D,"Yes")
 
Last edited:
Upvote 0
And here's a Power Query version.

Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Arrived", type text}, {"Name", type text}, {"Group", type text}, {"Award", type any}}),
    #"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Name"}),
    #"Reordered Columns" = Table.ReorderColumns(#"Removed Columns",{"Group", "Arrived", "Award"}),
    #"Added Custom" = Table.AddColumn(#"Reordered Columns", "Custom", each [Arrived]="X"),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom.1", each [Arrived]="X" and [Award]="Yes"),
    #"Removed Columns1" = Table.RemoveColumns(#"Added Custom1",{"Arrived", "Award"}),
    #"Renamed Columns" = Table.RenameColumns(#"Removed Columns1",{{"Custom", "Arrived"}, {"Custom.1", "Arrived and Award"}}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Renamed Columns",{{"Arrived", Int64.Type}, {"Arrived and Award", Int64.Type}}),
    #"Grouped Rows" = Table.Group(#"Changed Type1", {"Group"}, {{"Arrived", each List.Sum([Arrived]), type number}, {"Arrived and Award", each List.Sum([Arrived and Award]), type number}}),
    #"Sorted Rows" = Table.Sort(#"Grouped Rows",{{"Group", Order.Ascending}})
in
    #"Sorted Rows"
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,954
Members
449,095
Latest member
nmaske

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