COUNTIF, MATCH, and OFFSET in Array

adamscourfield

New Member
Joined
Nov 28, 2019
Messages
7
Office Version
  1. 2010
Platform
  1. MacOS
Hi all,

I hoping for some advice here. I am trying to calculate the success rate of members of staff. I have each student's score in a number of subjects (A2:J6) and there teacher for each subject (L:U)
I want to COUNT the total number of student scores over a certain amount (e.g. >5) for the member of staff in cell A9. I can use a COUNTIF(OFFSET combination to count the number of scores over a certain amount, and I can count how many students each member of staff teaches with a COUNT(MATCH but I can't figure out how to make them work together.

To summerise, I want to:

COUNT how many times the teacher in A9 has got students more than a grade 5 across across range (A2:J6), but only in the subjects that they teach them in (hence the OFFSET of -11 columns to return the value). I have attached a screenshot to hopefully make things a little clearer.
Screenshot 2019-11-28 at 17.58.06.png

*I am new to this forum so I hope I have followed the procedures correctly. Many thanks in advance for any help.


A
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
If the teachers per subject don't change, as shown in your sample. Then try
=COUNTIF(INDEX(A2:J6,0,MATCH(INDEX(L1:U1,MATCH(A9,L2:U2,0)),A1:J1,0)),">5")
 
Upvote 0
Thanks Fluff,

What if I wanted to search throughout the entire range (L2:U6)? Also on the full data some teachers might teach different subjects so the formula would have to account for that. Is that possible?

A
 
Upvote 0
That's almost certainly posible, but unfortunately beyond my knowledge of formulae.
 
Upvote 0
This works also:

Book1
ABCDEFGHIJKLMNOPQRSTU
1EnglishMathScienceHistoryGeographyPEMFLMusicArtPEEnglishMathScienceHistoryGeographyPEMFLMusicArtPE
25775906755HPEALAMWAAOSWFECGRDWOMWAMWAPGE
36675907743HPEALAMWAAOSWFECGRDWOEPRAMOPGE
42232303533HPEALAAOSAOSWFECGRDWOPGEAMOPGE
53021201240HPEALAMWAAOSHPECGRDWOEPRAMOPGE
65353806655HPEALAMWAAOSWFECGRDWOEPRAMOPGE
7
8Teacher>5
9MWA3
Sheet1
Cell Formulas
RangeFormula
B9B9=SUMPRODUCT(--($A$2:$J$6>5),--($L$2:$U$6=A9))


I recommend a better data structure, however, example to follow.....
 
Upvote 0
Book1
ABCDEFG
1StudentSubjectScoreTeacherTeacher>5
2AAAEnglish5HPEMWA3
3AAAMath7ALA
4AAAScience7MWA
5AAAHistory5AOS
6AAAGeography9WFE
7AAAPE0CGR
8AAAMFL6DWO
9AAAMusic7MWA
10AAAArt5MWA
11AAAPE5PGE
12BBBEnglish6HPE
13BBBMath6ALA
14BBBScience7MWA
15BBBHistory5AOS
16BBBGeography9WFE
17BBBPE0CGR
18BBBMFL7DWO
19BBBMusic7EPR
20BBBArt4AMO
21BBBPE3PGE
22CCCEnglish2HPE
23CCCMath2ALA
24CCCScience3AOS
25CCCHistory2AOS
26CCCGeography3WFE
27CCCPE0CGR
28CCCMFL3DWO
29CCCMusic5PGE
30CCCArt3AMO
31CCCPE3PGE
32DDDEnglish3HPE
33DDDMath0ALA
34DDDScience2MWA
35DDDHistory1AOS
36DDDGeography2HPE
37DDDPE0CGR
38DDDMFL1DWO
39DDDMusic2EPR
40DDDArt4AMO
41DDDPE0PGE
42EEEEnglish5HPE
43EEEMath3ALA
44EEEScience5MWA
45EEEHistory3AOS
46EEEGeography8WFE
47EEEPE0CGR
48EEEMFL6DWO
49EEEMusic6EPR
50EEEArt5AMO
51EEEPE5PGE
Sheet4
Cell Formulas
RangeFormula
G2G2=COUNTIFS($C$2:$C$51,">5",$D$2:$D$51,F2)



will show you how to unpivot
 
Upvote 0
Thank you so much Sheetspread.

I am working on Mac however, and function has been removed for Excel for Mac 2016 which is extremely frustrating. However I have a better understanding of how to layout the data, which is great.

If you have any Mac related advice I would be highly appreciative.

A
 
Upvote 0
=SUM((IF($L$2:$U$6=A9,IF($A$2:$J$6>5,1)))) ctrl-shift-enter also works in windows

Not sure about mac (which might be cmd-shift enter?)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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