Class Size Calculator Formula

Understand the math behind the class size calculator. Each variable explained with a worked example.

Formulas Used

Sections Needed

sections_needed = ceil(total_students / max_per_class)

Average Class Size

avg_class_size = total_students / ceil(total_students / max_per_class)

Total Empty Seats

empty_seats = ceil(total_students / max_per_class) * max_per_class - total_students

Variables

VariableDescriptionDefault
total_studentsTotal Enrolled Students150
max_per_classMaximum Class Size30

How It Works

How to Calculate Class Sections

Determine how many sections are needed to serve all students within size limits.

Formula

Sections Needed = ceil(Total Students / Max Class Size)

Average Size = Total Students / Sections

Rounding up ensures no class exceeds the maximum.

Worked Example

150 students need to be placed in classes with a maximum of 30.

total_students = 150max_per_class = 30
  1. 01Sections needed = ceil(150 / 30) = 5
  2. 02Average class size = 150 / 5 = 30
  3. 03Empty seats = 5 x 30 - 150 = 0

Ready to run the numbers?

Open Class Size Calculator