Countif has me baffled

GallivantingOne

New Member
Joined
May 9, 2023
Messages
12
Office Version
  1. 365
Platform
  1. Windows
I am trying to use countif to determine locations based on data in a number of fields. My data is set up like

Team NameNorthSouthEastWest
Cedars U13
10​
1​
1​
1​
DateStartEndArenaHome TeamN/S/E/WAway TeamN/S/E/WDivision
04/03/202320:3021:30MPSLionheartEastBenchwarmersEastU18Div2
04/04/202317:3018:30CDBAvengersNorthRaptorsNorthU9Div
04/04/202319:4520:45CMMScreaming SquirrelsNorthStrathcona Jr BruinsNorthU11Div1
04/04/202319:3020:30CTMLucky Puckers 3.0SouthBlack AcesSouthU18Div1
04/04/202317:3018:30CVADangle DogsWestCondorsWestU15Div2
04/04/202320:0021:00GABardownski'sWestThe CedarsWestU11Div1A
04/04/202317:1518:15GRFLionheartEastShort SticksEastU15Div1
04/04/202317:3018:30GTASniper CatsSouthRoyalsSouthU18Div1
04/04/202317:4518:45KMAStony Mighty DucksSouthAvengersSouthU9Div

The schedule information is contained in the table with Date, Start, End, Arena, Home Team, N/S/E/W, Away Team, N/S/E/W, and Division. In these fields, Home Team and Away Team are selected from a drop down menu based on the teams in the Division column. What I am trying to do, is determine how many of each location for a selected team. At the top of the sheet I have Team Name (again, a drop down menu referring to a table with all team names) and I want it to calculate how many North, South, East and West for that team based on the table below it.

I am using =COUNTIF('All Ice'!F6:F26:'All Ice'!H6:H26,N20&M21) where F6:F26 is the first N/S/E/W/ column in the table, H6:H26 is the second N/S/E/W column, N20 is the cell below North and M21 is the cell under Team Name. I'm not even sure if this is possible or if I am using Countif correctly.

Any advise would be greatly appreciated.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Paste this on B2 and drag it until column E
Excel Formula:
=COUNTIFS($E$6:$E$26, $A2, $F$6:$F$26,B$1)
 
Upvote 0
I need to calculate location whether or not the team is in Column E (Home Team) or Column G (Away Team) and if the N/S/E/W/ is in column F or H. Does that make sense? Could I just put an & to expand this selection like =COUNTIFS($E$6:$E$26&$G$6:$G$26,$A2,$F$6:$F$26&$H$6:$H$26,B$1)
 
Upvote 0
OK, so =SUM(COUNTIF(INDIRECT({"F6:F25","H6:H25"}),B$1)) in cell B2 will give me all of the cells with North for both columns F & H but I don't see how to specify that I only want the sum of North listed for the team in A2.
 
Upvote 0
I am not sure, but please try -

=COUNTIFS($E$6:$E$14,$A$2,$G$6:$G$14,$A$2,$F$6:$F$14,B1,$H6:$H14,B1)
 
Upvote 0
Paste this on B2 and drag it until column E
Excel Formula:
=COUNTIFS($E$6:$E$26, $A2, $F$6:$F$26,B$1)
That works for columns E & F but I need to combine columns E & G in the first set and columns F & H in the second set.
 
Upvote 0
Do you have this "Cedars U13" as it is in "E" or "G" column? Because i dont see the division added eg: "U13" in any other names in E & G
 
Upvote 0
Do you have this "Cedars U13" as it is in "E" or "G" column? Because i dont see the division added eg: "U13" in any other names in E & G
Sorry, no it is not in the columns but that should return values of 0 for each of the North, South, East and West fields. Poor example for me to have put up.
 
Upvote 0
I need to calculate location whether or not the team is in Column E (Home Team) or Column G (Away Team) and if the N/S/E/W/ is in column F or H. Does that make sense? Could I just put an & to expand this selection like =COUNTIFS($E$6:$E$26&$G$6:$G$26,$A2,$F$6:$F$26&$H$6:$H$26,B$1)

Excel Formula:
=COUNTIFS($E$6:$E$26, $A2, $F$6:$F$26,B$1)+COUNTIFS($E$6:$E$26, $A2, $H$6:$H$26,B$1)+COUNTIFS($G$6:$G$26, $A2, $F$6:$F$26,B$1)+COUNTIFS($G$6:$G$26, $A2, $H$6:$H$26,B$1)
 
Upvote 0
Solution

Forum statistics

Threads
1,215,003
Messages
6,122,655
Members
449,091
Latest member
peppernaut

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