How to Make Class Rosters from Google Sheets: One PDF per Class, Sorted by Last Name, with Seat Counts and an Attendance Grid (2026)
Most schools, tutoring centers, after-school programs and coaches end up with the same spreadsheet: one long list of who is in which class. What each teacher actually needs is their own list, sorted by last name, with the right count and room to take attendance, and making those by filtering, copying and printing one class at a time is where an evening goes. This guide keeps the enrollment list as the one place you edit, adds counts and checks with formulas, shows any class on screen with a dropdown, and uses a free Apps Script to save one roster PDF per class in a Drive folder, with students A–Z, preferred names, enrolled against capacity, a waitlist and blank attendance columns.
For one list of everyone at a single event (a sign-in sheet and seating lists), the event sign-in sheet guide fits better. For a report or certificate per student, see student progress reports and training completion certificates.
Step 1: an Enrollments tab with one row per student per class
Name a tab Enrollments and type these headers in row 1. A student in four classes has four rows, so changing a schedule means editing one row, not rebuilding a list. H and I are formulas.
| Col | Header | What goes in it |
|---|---|---|
| A | Student ID | Whatever ID your school uses. It is how the checks tell two students with the same name apart. Use Format › Number › Plain text if IDs have leading zeros. |
| B, C | Last name, First name | In separate columns, so the roster can sort by last name |
| D | Goes by | A preferred name, if the student uses one. It is shown in brackets after the legal name. |
| E | Grade | Grade or year level (or leave it empty) |
| F | Class | The class code exactly as on the Classes tab. A Data › Data validation › Dropdown (from a range) with Classes!A2:A stops typos. |
| G | Status | A Data › Data validation dropdown with Enrolled, Waitlist and Dropped |
| H, I | Roster name, Check | Formulas, below |
Roster name (H2, filled down) is “Last, First”, with the preferred name in brackets:
=IF(B2="", C2, B2&IF(C2="", "", ", "&C2))&IF(D2="", "", " ("&D2&")")
Check (I2) is empty when the row is fine. Otherwise it says No ID, Unknown class (the class isn’t on the Classes tab yet), or Listed twice (the same Student ID twice in one class, not counting Dropped rows). It uses COUNTIF and COUNTIFS:
=IF(F2="", "", IF(A2="", "No ID", IF(COUNTIF(Classes!$A$2:$A, F2)=0, "Unknown class", IF(AND(G2<>"Dropped", COUNTIFS($A$2:$A, A2, $F$2:$F, F2, $G$2:$G, "<>Dropped")>1), "Listed twice", ""))))
| A Student ID | B Last name | C First name | D Goes by | E Grade | F Class | G Status | H Roster name | I Check |
|---|---|---|---|---|---|---|---|---|
| 1001 | Alvarez | Sofia | 9 | ALG1-P2 | Enrolled | Alvarez, Sofia | ||
| 1002 | Nguyen | Thanh | Tim | 9 | ALG1-P2 | Enrolled | Nguyen, Thanh (Tim) | |
| 1003 | Lee | Jordan | 9 | ALG1-P2 | Enrolled | Lee, Jordan | ||
| 1004 | Leeds | Ava | 9 | ALG1-P2 | Enrolled | Leeds, Ava | ||
| 1005 | Okoro | Daniel | Danny | 9 | ALG1-P2 | Enrolled | Okoro, Daniel (Danny) | |
| 1006 | Park | Hana | 9 | ALG1-P2 | Waitlist | Park, Hana | ||
| 1001 | Alvarez | Sofia | 9 | BIO-P3 | Enrolled | Alvarez, Sofia | ||
| 1003 | Lee | Jordan | 9 | BIO-P3 | Enrolled | Lee, Jordan | ||
| 1006 | Park | Hana | 9 | BIO-P3 | Enrolled | Park, Hana | ||
| 1007 | Schmidt | Lukas | 10 | BIO-P3 | Enrolled | Schmidt, Lukas | ||
| 1008 | Haddad | Mira | 10 | BIO-P3 | Enrolled | Haddad, Mira | ||
| 1010 | Reyes | Carmen | 10 | BIO-P3 | Waitlist | Reyes, Carmen | ||
| 1002 | Nguyen | Thanh | Tim | 9 | ART-P5 | Enrolled | Nguyen, Thanh (Tim) | |
| 1007 | Schmidt | Lukas | 10 | ART-P5 | Dropped | Schmidt, Lukas | ||
| 1008 | Haddad | Mira | 10 | ART-P5 | Enrolled | Haddad, Mira | ||
| 1004 | Leeds | Ava | 9 | HIST-P1 | Enrolled | Leeds, Ava | ||
| 1005 | Okoro | Daniel | Danny | 9 | HIST-P1 | Enrolled | Okoro, Daniel (Danny) | Listed twice |
| 1005 | Okoro | Daniel | Danny | 9 | HIST-P1 | Enrolled | Okoro, Daniel (Danny) | Listed twice |
| 1009 | Ito | Ken | 10 | GEO-P4 | Enrolled | Ito, Ken | Unknown class |
Example data: the students, teachers and classes are made up.
Step 2: a Classes tab with counts and seats left
Make a second tab named Classes, one row per class (one roster each). A to G are typed, H to J are formulas, and K and L are filled in by the script.
| Col | Header | What goes in it |
|---|---|---|
| A | Class | A short unique code per section, such as ALG1-P2 for Algebra 1 in period 2 |
| B to F | Course, Teacher, Teacher email, Period, Room | Printed at the top of the roster. Teacher email is only needed if the script emails the rosters. |
| G | Capacity | Seats in the room or the section limit (or leave it empty) |
| H, I, J | Enrolled, Seats left, Waitlist | Formulas, below |
| K, L | Roster PDF, Made at | Left empty for the script |
Put these in H2, I2 and J2 and fill them down:
=IF(A2="", "", COUNTIFS(Enrollments!$F$2:$F, A2, Enrollments!$G$2:$G, "Enrolled"))
=IF(OR(A2="", G2=""), "", G2-H2)
=IF(A2="", "", COUNTIFS(Enrollments!$F$2:$F, A2, Enrollments!$G$2:$G, "Waitlist"))
| A Class | B Course | C Teacher | D Teacher email | E Period | F Room | G Capacity | H Enrolled | I Seats left | J Waitlist |
|---|---|---|---|---|---|---|---|---|---|
| ALG1-P2 | Algebra 1 | Ms. Rivera | rivera@example.edu | 2 | 114 | 5 | 5 | 0 | 1 |
| BIO-P3 | Biology | Mr. Chen | chen@example.edu | 3 | L2 | 4 | 5 | -1 | 1 |
| ART-P5 | Studio Art | Ms. Okafor | okafor@example.edu | 5 | A1 | 3 | 2 | 1 | 0 |
| HIST-P1 | World History | Mr. Brooks | brooks@example.edu | 1 | 207 | 6 | 3 | 3 | 0 |
The Classes tab for the example. Roster PDF and Made at (K, L) are left out.
Algebra 1 is exactly full with one student waiting. Biology has 5 students in 4 seats, so Seats left is -1. World History shows 3 enrolled, but Daniel is on two rows (both are flagged Listed twice), so it really has 2: delete the extra row and the count corrects itself. Ken is enrolled in GEO-P4, which isn’t on the Classes tab yet, so he would be on nobody’s roster; that is what Unknown class is for.
Then add four Format › Conditional formatting rules with Custom formula is: select A2:L on the Classes tab for the first two, and A2:I on the Enrollments tab for the other two.
| Tab | Custom formula | Color | Meaning |
|---|---|---|---|
| Classes | =AND(ISNUMBER($I2), $I2<0) | Red | More students enrolled than seats |
| Classes | =AND(ISNUMBER($I2), $I2=0) | Amber | Full |
| Enrollments | =$I2<>"" | Orange | The row needs fixing |
| Enrollments | =$G2="Dropped" | Grey text | Dropped, kept for the record |
Step 3: one class on screen
For a quick look (or a one-off printout of a single class), make a tab named Roster. Put a Data › Data validation › Dropdown (from a range) with Classes!A2:A in B1, type Student, ID and Grade in A2:C2, and put this in A3. It uses FILTER to keep the enrolled students of the chosen class and SORT to order them. Google’s SORT page says a sort column can be “a range outside of range”, which is what lets it sort by the Last name column and then the First name column while showing the “Last, First” column:
=IFERROR(SORT(FILTER({Enrollments!H2:H, Enrollments!A2:A, Enrollments!E2:E}, Enrollments!F2:F=B1, Enrollments!G2:G="Enrolled"), FILTER(Enrollments!B2:B, Enrollments!F2:F=B1, Enrollments!G2:G="Enrolled"), TRUE, FILTER(Enrollments!C2:C, Enrollments!F2:F=B1, Enrollments!G2:G="Enrolled"), TRUE), "No students enrolled")
With ALG1-P2 chosen in B1:
| A Student | B ID | C Grade |
|---|---|---|
| Alvarez, Sofia | 1001 | 9 |
| Lee, Jordan | 1003 | 9 |
| Leeds, Ava | 1004 | 9 |
| Nguyen, Thanh (Tim) | 1002 | 9 |
| Okoro, Daniel (Danny) | 1005 | 9 |
The Roster tab for ALG1-P2. If FILTER finds nobody it returns #N/A, which IFERROR turns into “No students enrolled”.
Lee comes before Leeds, and Nguyen sorts by his legal last name even though he goes by Tim. Hana is on the waitlist, so she isn’t on the list.
Step 4: one roster PDF per class
Open Extensions › Apps Script, paste the script below, set FOLDER_ID (the last part of the Drive folder’s URL), SCHOOL and TERM, and save. Then:
- Reload the spreadsheet. A Rosters menu appears (it is created by the script’s
onOpen, as described in Google’s custom menus page). - Choose Rosters › Make rosters for all classes and approve the permissions.
PREVIEWis true, so it makes two PDFs named PREVIEW and writes nothing to the sheet. - Open the previews. When they look right, set
PREVIEW = false, save, and run it again.
/**
* Class rosters from Google Sheets: one PDF per class, students A-Z by last name, with an attendance grid.
*
* Tab "Enrollments" (row 1 = headers, extra columns are fine), one row per student per class:
* Student ID | Last name | First name | Goes by | Grade | Class | Status (Enrolled, Waitlist or Dropped)
* Tab "Classes", one row per class (one PDF each):
* Class | Course | Teacher | Teacher email | Period | Room | Capacity | ... | Roster PDF | Made at
*
* Each run makes a fresh PDF for every class (or only the class rows you have selected) in your
* Drive folder and writes its link and the time back to the class row. Run it with PREVIEW = true
* first: it makes up to 2 PDFs named "PREVIEW", writes nothing to the sheet, and emails (if
* EMAIL_TEACHERS is on) go only to you.
*/
const FOLDER_ID = 'PASTE_OUTPUT_FOLDER_ID';
const SCHOOL = 'Your School';
const TERM = 'Spring 2027';
const ATTENDANCE_COLUMNS = 5; // blank columns for dates or ticks (0 = none)
const SHOW_WAITLIST = true; // list waitlisted students under the table
const EMAIL_TEACHERS = false; // true emails each PDF to the class's Teacher email
const PREVIEW = true; // set to false for the real run
const KEEP_DOCS = false; // true keeps the Google Doc next to each PDF
const MAX_PER_RUN = 40;
function onOpen() {
SpreadsheetApp.getUi().createMenu('Rosters')
.addItem('Make rosters for all classes', 'makeAllRosters')
.addItem('Make rosters for selected class rows', 'makeSelectedRosters')
.addToUi();
}
function makeAllRosters(now) {
return makeRosters_(null, now);
}
function makeSelectedRosters(now) {
const sh = SpreadsheetApp.getActive().getActiveSheet();
if (sh.getName() !== 'Classes') {
SpreadsheetApp.getUi().alert('Select one or more rows on the Classes tab first.');
return null;
}
const range = sh.getActiveRange();
const rows = {};
for (let r = range.getRow(); r < range.getRow() + range.getNumRows(); r++) rows[r] = true;
return makeRosters_(rows, now);
}
function makeRosters_(onlyRows, now) {
now = now instanceof Date ? now : new Date();
const lock = LockService.getDocumentLock();
if (!lock.tryLock(30000)) return { busy: true }; // another run is busy; try again in a minute
try {
const started = Date.now();
const ss = SpreadsheetApp.getActive();
const tz = ss.getSpreadsheetTimeZone();
const cs = ss.getSheetByName('Classes'), es = ss.getSheetByName('Enrollments');
if (!cs || !es) throw new Error('This needs a "Classes" tab and an "Enrollments" tab.');
const cv = cs.getDataRange().getDisplayValues(); // print values exactly as the sheet shows them
const ev = es.getDataRange().getDisplayValues();
const c = columns_(cv[0], ['Class', 'Course', 'Teacher', 'Teacher email', 'Period', 'Room', 'Capacity', 'Roster PDF', 'Made at'], 'Classes');
const e = columns_(ev[0], ['Student ID', 'Last name', 'First name', 'Goes by', 'Grade', 'Class', 'Status'], 'Enrollments');
const problems = [];
const classes = {};
for (let r = 1; r < cv.length; r++) {
const key = cv[r][c['Class']].trim().toLowerCase();
if (key) classes[key] = { enrolled: [], waitlist: [], seen: {} };
}
for (let r = 1; r < ev.length; r++) {
const v = ev[r].map((x) => String(x).trim());
const last = v[e['Last name']], first = v[e['First name']], cls = v[e['Class']];
if (!last && !first && !cls) continue; // empty row
const where = 'Enrollments row ' + (r + 1);
if (!last && !first) { problems.push(where + ': no name'); continue; }
const status = v[e['Status']].toLowerCase();
if (!cls) { problems.push(where + ': no Class'); continue; }
const k = classes[cls.toLowerCase()];
if (!k) { problems.push(where + ': class ' + cls + ' is not on the Classes tab'); continue; }
if (['enrolled', 'waitlist', 'dropped'].indexOf(status) < 0) { problems.push(where + ': Status must be Enrolled, Waitlist or Dropped'); continue; }
if (status === 'dropped') continue;
const id = v[e['Student ID']];
if (!id) problems.push(where + ': no Student ID (listed anyway)');
else if (k.seen[id.toLowerCase()]) { problems.push(where + ': student ' + id + ' is already in ' + cls + ' on row ' + k.seen[id.toLowerCase()] + ' (left out)'); continue; }
else k.seen[id.toLowerCase()] = r + 1;
const goes = v[e['Goes by']];
const s = { row: r + 1, id: id, last: last, first: first, grade: v[e['Grade']],
name: (last && first ? last + ', ' + first : last || first) + (goes ? ' (' + goes + ')' : '') };
(status === 'enrolled' ? k.enrolled : k.waitlist).push(s);
}
const folder = DriveApp.getFolderById(FOLDER_ID);
const me = Session.getEffectiveUser().getEmail();
const stamp = Utilities.formatDate(now, tz, 'yyyy-MM-dd');
const printed = Utilities.formatDate(now, tz, 'MMMM d, yyyy');
const over = [], noEmail = [];
let made = 0, emailed = 0, stopped = '';
for (let r = 1; r < cv.length; r++) {
if (onlyRows && !onlyRows[r + 1]) continue;
const row = cv[r].map((x) => String(x).trim());
const code = row[c['Class']];
if (!code) continue;
if (made >= (PREVIEW ? 2 : MAX_PER_RUN)) { stopped = 'limit'; break; }
if (Date.now() - started > 270000) { stopped = 'time'; break; } // stay inside the 6-minute limit
const addr = row[c['Teacher email']];
const canEmail = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(addr);
if (EMAIL_TEACHERS && canEmail && MailApp.getRemainingDailyQuota() < 1) { stopped = 'quota'; break; }
const k = classes[code.toLowerCase()];
const list = k.enrolled.slice().sort(byName_);
const course = row[c['Course']];
const capText = row[c['Capacity']];
const cap = capText === '' ? NaN : Number(capText);
if (!isNaN(cap) && list.length > cap) over.push(code + ' (' + list.length + ' of ' + cap + ')');
const name = (PREVIEW ? 'PREVIEW ' : '') + [TERM, code, course, 'roster', stamp].filter(String).join(' ');
const doc = DocumentApp.create(name);
const file = DriveApp.getFileById(doc.getId());
file.moveTo(folder);
const body = doc.getBody();
body.setMarginTop(36).setMarginBottom(36).setMarginLeft(36).setMarginRight(36);
const title = body.getParagraphs()[0]; // a new Doc starts with one empty paragraph
title.setText(course ? course + ' (' + code + ')' : code);
title.setHeading(DocumentApp.ParagraphHeading.HEADING2);
const info = [SCHOOL, TERM, row[c['Teacher']],
row[c['Period']] ? 'Period ' + row[c['Period']] : '', row[c['Room']] ? 'Room ' + row[c['Room']] : ''];
body.appendParagraph(info.filter(String).join(' \u00b7 ')).setHeading(DocumentApp.ParagraphHeading.NORMAL);
const count = list.length + ' enrolled' + (isNaN(cap) ? '' : ' of ' + cap + ' seats' +
(list.length > cap ? ' (over by ' + (list.length - cap) + ')' : '')) + ' \u00b7 Printed ' + printed;
body.appendParagraph(count).setHeading(DocumentApp.ParagraphHeading.NORMAL);
if (list.length) {
const blanks = [];
for (let i = 0; i < ATTENDANCE_COLUMNS; i++) blanks.push('');
const cells = [['#', 'Student', 'ID', 'Grade'].concat(blanks)].concat(
list.map((s, i) => [String(i + 1), s.name, s.id, s.grade].concat(blanks)));
const table = body.appendTable(cells);
table.getRow(0).editAsText().setBold(true);
for (let i = 1; i < table.getNumRows(); i++) table.getRow(i).setMinimumHeight(20);
const width = (body.getPageWidth() || 612) - 72; // 612 pt = US Letter
const fixed = [24, 170, 60, 45];
fixed.forEach((w, i) => table.setColumnWidth(i, w));
const rest = Math.max(30, Math.floor((width - 299) / Math.max(1, ATTENDANCE_COLUMNS)));
for (let i = 0; i < ATTENDANCE_COLUMNS; i++) table.setColumnWidth(4 + i, rest);
} else {
body.appendParagraph('No students enrolled yet.');
}
if (SHOW_WAITLIST && k.waitlist.length) {
body.appendParagraph('Waitlist, in sign-up order: ' + k.waitlist.map((s) => s.name).join('; '));
}
doc.saveAndClose();
const pdf = folder.createFile(file.getAs(MimeType.PDF)).setName(name + '.pdf');
if (!KEEP_DOCS) file.setTrashed(true);
if (!PREVIEW) {
cs.getRange(r + 1, c['Roster PDF'] + 1).setValue(pdf.getUrl());
cs.getRange(r + 1, c['Made at'] + 1).setValue(now);
}
made++;
if (EMAIL_TEACHERS) {
if (!canEmail) { noEmail.push(code); continue; }
MailApp.sendEmail({
to: PREVIEW ? me : addr,
subject: (PREVIEW ? '[PREVIEW to ' + addr + '] ' : '') + 'Class roster: ' + (course || code) + ' (' + code + '), ' + TERM,
body: 'Hi ' + (row[c['Teacher']] || '') + ',\n\nThe roster for ' + (course || code) + ' is attached: ' + count + '.' +
(k.waitlist.length ? ' Waitlist: ' + k.waitlist.length + '.' : '') + '\n\n' + SCHOOL,
name: SCHOOL,
attachments: [pdf.getAs(MimeType.PDF)]
});
emailed++;
}
}
const note = 'Made ' + made + ' roster(s)' + (PREVIEW ? ' in PREVIEW (nothing written to the sheet)' : '') +
(EMAIL_TEACHERS ? ', emailed ' + emailed : '') + '.' +
(over.length ? ' Over capacity: ' + over.join(', ') + '.' : '') +
(problems.length ? ' ' + problems.length + ' enrollment problem(s), see the log.' : '') +
(noEmail.length ? ' No valid Teacher email for ' + noEmail.join(', ') + '.' : '') +
(stopped ? ' Stopped early (' + stopped + '); run it again for the rest.' : '');
problems.forEach((p) => console.log(p));
ss.toast(note, 'Rosters', 10);
return { made: made, emailed: emailed, over: over, problems: problems, noEmail: noEmail, stopped: stopped };
} finally {
lock.releaseLock();
}
}
/** Finds each needed header (ignoring case and spaces) or stops with a clear message. */
function columns_(header, need, tab) {
const head = header.map((h) => String(h).trim().toLowerCase());
const missing = need.filter((n) => head.indexOf(n.toLowerCase()) < 0);
if (missing.length) throw new Error('Missing column(s) on ' + tab + ': ' + missing.join(', '));
const c = {};
need.forEach((n) => { c[n] = head.indexOf(n.toLowerCase()); });
return c;
}
/** Last name, then first name, ignoring case and accents; ties keep sheet order. */
function byName_(a, b) {
const cmp = (x, y) => String(x).localeCompare(String(y), undefined, { sensitivity: 'base', numeric: true });
return cmp(a.last || a.first, b.last || b.first) || cmp(a.last ? a.first : '', b.last ? b.first : '') || a.row - b.row;
}
For the example, the Algebra 1 roster comes out like this (the five unlabeled columns are the attendance grid):
Algebra 1 (ALG1-P2)
Your School · Spring 2027 · Ms. Rivera · Period 2 · Room 114
5 enrolled of 5 seats · Printed November 23, 2026
| # | Student | ID | Grade | |||||
|---|---|---|---|---|---|---|---|---|
| 1 | Alvarez, Sofia | 1001 | 9 | |||||
| 2 | Lee, Jordan | 1003 | 9 | |||||
| 3 | Leeds, Ava | 1004 | 9 | |||||
| 4 | Nguyen, Thanh (Tim) | 1002 | 9 | |||||
| 5 | Okoro, Daniel (Danny) | 1005 | 9 |
Waitlist, in sign-up order: Park, Hana
What the script does
- One Doc and PDF per class row on the Classes tab, made with
DocumentAppand saved in your folder as, for example,Spring 2027 ALG1-P2 Algebra 1 roster 2026-11-23.pdf. The Doc is moved to the trash afterwards unlessKEEP_DOCSis true. The PDF’s link goes in Roster PDF and the time in Made at. - Students A–Z by last name, then first name, ignoring case and accents, numbered, with the preferred name in brackets, ID and grade. Only Enrolled rows are in the table; Dropped rows are left out, and Waitlist students are listed under the table in sign-up order (
SHOW_WAITLIST). - The count against capacity on every roster. For the example’s Biology class it says
5 enrolled of 4 seats (over by 1) · Printed November 23, 2026, and the end-of-run message lists over-capacity classes. - An attendance grid:
ATTENDANCE_COLUMNSblank columns (5 by default) to write dates in or tick. Set it to 0 for a plain list. The table is built with the BodyappendTablemethod from Google’s Document service reference. - Checks of its own. The script works from the typed columns, not the formulas: a row with no name or class, a class that isn’t on the Classes tab, or an unknown Status is skipped, and a second row for the same Student ID in a class is left out, so Daniel is listed once on the World History roster. Each problem is written to the script’s log (with
console.log) and counted in the message at the end. A row with no Student ID is still listed, because leaving a student off a roster is worse. - Only some classes. Select one or more rows on the Classes tab and choose Rosters › Make rosters for selected class rows to remake just those after a schedule change. Every run makes new files, so old PDFs stay in the folder until you delete them.
- Email to teachers if
EMAIL_TEACHERSis true: each class’s PDF goes to its Teacher email, and in preview only to you, with the real address in the subject. The Apps Script quotas page lists 100 email recipients a day on a consumer Gmail account and 1,500 on Google Workspace, and the script checks the remaining quota before each one. - Safe to run twice. A document lock stops two runs overlapping, and it stops at
MAX_PER_RUNrosters or about 4½ minutes (Apps Script’s limit is 6 minutes per run), so a big school can just run it again for the rest.
Keeping rosters current
- Schedule changes: change the student’s Class or Status on the Enrollments row (Dropped instead of deleting), then remake the affected classes with the selected-rows menu item.
- New sections: add the class to the Classes tab first, then enroll students. Unknown class on the Enrollments tab means a class row is missing.
- A new term: make a copy of the spreadsheet, change
TERM, and clear the Enrollments rows and the Roster PDF and Made at columns.
Pitfalls
- Class codes that almost match. “ALG1-P2 ” with a trailing space is not on the Classes tab as far as the formulas are concerned. The dropdown prevents most of it, and Data › Data cleanup › Trim whitespace fixes pasted codes. The comparisons ignore case.
- One “Name” column. A single “First Last” column sorts by first name. Split it into Last name and First name before building the roster.
- Numbers stored as text. Capacity must be a number for Seats left to work; IDs are best as plain text so 00123 keeps its zeros.
- Time zone. The date in the file name and the “Printed” line use the spreadsheet’s time zone (File › Settings › Time zone).
- Privacy. Student names and IDs are school records. Keep the spreadsheet and the roster folder shared only with the staff who need them, and follow your school’s rules on where student data can be stored.
FAQ
How do I make a class roster in Google Sheets?
Keep one Enrollments tab with a row per student per class (Student ID, Last name, First name, Goes by, Grade, Class, Status) and a Classes tab with a row per class. For an on-screen roster, pick a class in a dropdown and list its enrolled students A–Z with SORT and FILTER. For printable rosters, the Apps Script on this page saves one PDF per class with the students in a numbered table.
How do I sort a class list by last name in Google Sheets?
Keep last and first names in separate columns and sort by both. SORT accepts a sort column that is a range outside the data, so =SORT(FILTER(names, conditions), FILTER(last names, conditions), TRUE, FILTER(first names, conditions), TRUE) sorts by last name and then first name while showing a “Last, First” column. Sorting a single “First Last” column sorts by first name instead.
How do I print a separate roster for each class from one sheet?
Google Sheets can print or download a sheet as one PDF, but it has no option to make a separate file for each group of rows. The script on this page groups the Enrollments rows by class and makes a Google Doc and PDF for each row of the Classes tab, with the teacher, period, room, the enrolled count against capacity, a numbered student table and blank attendance columns, and writes each PDF’s link back to the class row.
How do I count students per class and see which classes are full?
On the Classes tab, Enrolled is =IF(A2="", "", COUNTIFS(Enrollments!$F$2:$F, A2, Enrollments!$G$2:$G, "Enrolled")) and Seats left is the capacity minus that. A conditional-formatting rule colors a class amber when Seats left is 0 and red when it is negative, so over-enrolled sections stand out.
How do I handle students who drop a class or are on a waitlist?
Don’t delete the row: set Status to Dropped (it stays in the history and stops counting) or Waitlist. Waitlisted students are counted separately, left out of the student table and listed under it in sign-up order, so the teacher can see who is next. When a seat opens, change the student’s Status to Enrolled and make that roster again.
Can I email each teacher their class roster?
Yes. Set EMAIL_TEACHERS = true in the script and each roster PDF is emailed to the class’s Teacher email. Run it with PREVIEW = true first: it makes two PDFs named PREVIEW, writes nothing to the sheet, and sends the emails only to you. Apps Script’s daily email quota is 100 recipients on a consumer Gmail account and 1,500 on Google Workspace.
See SheetWeave
Related Google Sheets guides
- How to generate a PDF or Google Doc for each row in Google Sheets
- Find and remove duplicates in Google Sheets
- Compare two columns or two sheets for duplicates
- Find case-insensitive and fuzzy duplicates in Google Sheets
- Best Autocrat alternatives for mail merge to PDF and Docs
- Make invoices or certificates from Google Sheets rows
- Create sales quotes or estimates from Google Sheets
- Generate receipts from Google Sheets rows
- Create purchase orders from Google Sheets
- Make packing slips from Google Sheets orders
- Generate a PDF certificate from a Google Form response
- Issue numbered training completion certificates with expiry dates
- Make a PDF progress report for each student
- Generate offer letters from a Google Sheets hiring tracker
- Generate contracts and agreements from a Google Docs template
- Make work orders for service jobs from Google Sheets
- Email each row’s PDF as an attachment
- Automatic email reminders from a date column
- Contract renewal and expiration alerts from Google Sheets
- Track certificate of insurance (COI) expirations in Google Sheets
- Track employee license and certification expirations
- Track equipment and vehicle maintenance with reminders
- Equipment sign-out sheet with due-back and overdue reminders
- Track warranty expiration dates with reminders
- Birthday and work anniversary reminders from Google Sheets
- Rent due and lease renewal reminders from Google Sheets
- Send invoice payment reminders from Google Sheets
- Highlight overdue tasks and send email reminders
- Follow-up reminders for leads, clients and candidates
- Membership renewal reminders for clubs and associations
- Appointment reminder emails for clients
- Probation and performance review reminders for managers
- Inventory expiration dates with email alerts
- Domain and SSL certificate renewal reminders
- Name badges and place cards from a guest list
- Vehicle registration, inspection and insurance reminders
- Event sign-in sheets and table seating lists
- Pet vaccination expiry reminders for owners
- Customer account statements with aging
- Subscription tracker with renewal and free-trial reminders
- Mailing labels: one per household, clean addresses
- Volunteer shifts: open slots, reminders and rosters
- Year-end donor giving statements, one PDF per donor
- Volunteer hours verification letters, one PDF per request
- Instrument calibration due dates with email reminders
- Pay stubs from a payroll sheet, one PDF per employee
- Gift certificates with codes, balances and a redemption log
- Bill due dates: mark paid, 30-day totals and reminders
- Grant deadlines: LOIs, reports, owners and reminders
- Passport expiry: trips, the 6-month rule and renewal reminders
- Insurance renewals: premium changes and reminders
- Onboarding checklists: tasks from start dates, owner reminders
- Raffle tickets: numbered stubs, seller books, sales tracker
- SheetWeave vs Autocrat
- SheetWeave vs Document Studio
- SheetWeave vs RowDocs
Instructions refer to Google Sheets and Apps Script as they worked on November 23, 2026. Not affiliated with Google. Google Sheets and Google Docs are trademarks of Google LLC. Questions or corrections: hello@loomwise.app.