How to do a yes no calculation on matrix?

Matrix m has 2 columns class A and class B and 200 rows exam scores 0 - 100   Each row is 1 student

Want to sum the the number of students in class A with scores between 40 and 60