Counting Across Tables

leefletcher

New Member
Joined
Mar 22, 2018
Messages
29
Office Version
  1. 2019
Platform
  1. Windows
Hello!

I am trying to count items but they are linked across tables.

Sheet 1 - Has the schools listed by city
CitiesSchools
BostonMaple Elementary
BostonElm Middle School
BostonCedar Elementary
Los AngelesBamboo Elementary
New YorkPine High School
New YorkFicus High School

Sheet 2 - Shows which grade levels are in the school
SchoolsGrades
Woodruff Elementary1st-5th
Cedar Elementary5th-6th
Elm Middle School6th-8th
Ficus High School9th-10th
Landrum High School9th-12th
Northwest Elementaryk-5th

Sheet 3 - Tells me the grade level types that each grade level is assigned
GradesTypes
1st-5the
5th-6thm
6th-8thm
9th-10thh
9th-12thh
k-5the

How do I count the number of "types" in each town? Like this:
emh
Boston
1​
2​
0​
New York
0​
0​
2​
Los Angeles
1​
0​
0​
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

leefletcher Let's get the ball rolling. Now there are probably more solutions to this problem. This will at least get the discussion going. This might also generate more questions than answers. Usually some of the A Students will weigh in and come up with their solutions. Also note that Boston has 2 Elementary schools.​



Book1
ABCD
1ElementaryMiddleHigh
2Boston210
3New York002
4Los Angeles100
Results
Cell Formulas
RangeFormula
B2:D4B2=COUNTIFS(Sheet1!$A$2:$A$7,$A2,Sheet1!$B$2:$B$7,"*"&B$1&"*")

 
Upvote 0

leefletcher Let's get the ball rolling. Now there are probably more solutions to this problem. This will at least get the discussion going. This might also generate more questions than answers. Usually some of the A Students will weigh in and come up with their solutions. Also note that Boston has 2 Elementary schools.​



Book1
ABCD
1ElementaryMiddleHigh
2Boston210
3New York002
4Los Angeles100
Results
Cell Formulas
RangeFormula
B2:D4B2=COUNTIFS(Sheet1!$A$2:$A$7,$A2,Sheet1!$B$2:$B$7,"*"&B$1&"*")

Thank you for replying and for catching my mistake on the solution table. My struggle is that the 3 tables with the data are all on different worksheets (provided and updated by others).
 
Upvote 0
so...
1. update your profile about Excel version and OS
2. post proper examples using XL2BB
3. one workbook, 3 different sheets, correct?
 
Upvote 0
Thank you. I updated version and OS. Our Admins don't allow Add-ons, however.

Yes, the data is across 3 different sheets.
 
Upvote 0
Sheet 1 - Cities with schools
1607607510149.png


Sheet 2 - Schools with Grades
1607607547316.png


Sheet 3 - Grades with Grade Types
1607607575079.png


Need final sheet with Cities counting Grade Types
1607607624872.png


I've been able to accomplish this by adding columns to Sheets 1-3, but I don't own those sheets and any edits will be lost when new data is provided.
1607607510149.png
 
Upvote 0
Thanks for updating but I don't want to retype your data from the pictures, post examples as you did in the first post but with a proper data
 
Upvote 0
Thanks for updating but I wont retype your data from the pictures, post examples as you did in the first post but with a proper data
The actual (proper?) data is private information so I can't copy and paste. The only change would be that the cities are mental health clinics. We have 500+ clinicians in 1300+ schools across the state. Those clinicians work out of clinics which reside in cities. The data I've provided is a basic version. Maybe I don't understand what you mean by "proper data".
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,175
Members
452,615
Latest member
bogeys2birdies

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