COUNTIF and VLOOKUP with multiple tables

Chameleon64

New Member
Joined
May 10, 2018
Messages
40
I have a table of children, which school they attend and which year group they belong to (Sheet1). I have a second table (Sheet2) with the list of schools and in which geographic area they're located.

I would like a summary table (Sheet3) which summarises the numbers of children by year group and area. I was thinking a combination of COUNTIF and VLOOKUP but examples I've found don't seem relevant to this particular problem.

For operational reasons too boring to go into, I don't want a column on Sheet1 which VLOOKUPs the area for each school. Can anyone come up with a formula for Sheet3? Many thanks in advance!


Sheet1ABC
1ChildNameSchoolNameYearGroup
2Child_ASchool_A1
3Child_BSchool_B1
4Child_CSchool_A1
5Child_DSchool_A2
6Child_ESchool_B2
7Child_FSchool_A2

<tbody>
</tbody>


Sheet2AB
1SchoolNameArea
2School_AArea_1
3School_BArea_2

<tbody>
</tbody>


Sheet3ABC
1YearGroupArea_1Area_2
21 ? ?
32 ? ?

<tbody>
</tbody>
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Try

Array formula in Sheet3 B2 copied across and down
=SUM(IF(Sheet1!$C$2:$C$100=$A2,IF(ISNUMBER(MATCH(Sheet1!$B$2:$B$100,IF(Sheet2!$B$2:$B$100=B$1,Sheet2!$A$2:$A$100),0)),1)))
confirmed with Ctrl+Shift+Enter, not just Enter

M.
 
Upvote 0

Forum statistics

Threads
1,214,586
Messages
6,120,402
Members
448,958
Latest member
Hat4Life

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