How to Make Volunteer Hours Verification Letters from Google Sheets: One PDF per Request, with Dates and Totals (2026)
Sooner or later every volunteer program gets the same email: “Can you send a letter confirming my hours?” A student needs it for a graduation or honor-society requirement, someone else for a scholarship, a job application or a court-ordered community service condition, and each one wants a different date range, sent to a different place, often by Friday. If your hours live in a Google Sheet, the answer shouldn't be an afternoon of filtering rows and retyping totals into a letter. This guide sets up an Hours tab (one row per volunteer per day served), a Requests tab (one row per letter someone asks for), formulas that show each person's verified hours as you type, and a free Apps Script that makes one PDF letter per request: the total for exactly the dates asked for, what they did, a dated list of every day served and a signature block, with the link written back to the request.
How this differs from the other volunteer and certificate guides here: the volunteer shift guide fills shifts and reminds people before they come (its Signups tab can feed this script directly, see Step 5). Training certificates confirm a course was completed. A verification letter is different: it adds up many separate days of service for one person and one period, and someone at your organization signs it as a true record.
What schools, courts and programs look for
Requirements vary, so the first rule is: ask the volunteer whether the school, court or program has its own form. Many do, and some accept only theirs; your letter can then go with it as the supporting record. Where a letter on your letterhead is accepted, the details checked are nearly always the same: the volunteer's name, your organization's name and contact details, the dates of service, the total hours, a short description of the work, and the name, title, contact details and signature of the person who can vouch for it, plus the date of the letter.
Federal probation is a good example of why a dated log matters. The US Courts' guidance on the community service condition has the person provide written verification of completed hours to the probation officer, says the site should have a reliable manager who will give accurate information about attendance and participation, and notes that hours may be checked by contacting the service agency or reviewing its documentation. Some probation offices also use their own time sheet that the site supervisor dates and signs for each day worked (the District of Nevada's instructions are one example). That is why the letter below lists every day with its hours, and why the script only counts hours someone has marked as verified.
This guide is about producing an accurate record, not legal advice. Only sign for hours your organization can stand behind.
Step 1: an Hours tab, one row per volunteer per day
Name the tab Hours. The script finds columns by their header, so the order is up to you, and only Date, Volunteer and Hours are required; the formulas below assume this layout:
| Col | Header | What goes in it |
|---|---|---|
| A | Date | The day served, formatted as a date (Format › Number › Date). Text that only looks like a date won't work. |
| B | Volunteer ID | Optional: a stable code like V-0042. Rows with the same ID are one person even if the name was typed differently. Without IDs, rows are matched by Email, then by name, ignoring capitals and extra spaces. |
| C | Volunteer | The person's full name, as it should appear on the letter (schools and courts match it against their records, so use the legal name, not a nickname) |
| D | Optional | |
| E | Activity | What they did, in words someone outside your organization understands: “Sorting donated food”, “Reading tutor, grades 2–3”, not “Helper”. Blank prints as “Volunteer service”. |
| F | Supervisor | Optional: who was in charge that day. Printed in the dated list when filled in. |
| G | Hours | A number such as 2.5 (at most 24 per row). For start and end times, see below. |
| H | Verified | A checkbox (Insert › Checkbox) or the supervisor's initials. Only verified rows go on a letter. Blank, “No” or “Pending” means not yet. |
One row per person per day (or per shift, if they did two different things in a day) is what lets the letter list dates and lets you answer “which days?” months later. Ask whoever runs each session to tick Verified the same day, while they still remember who was there; checking off a month of rows at once is exactly what makes a record hard to vouch for. If you keep a paper sign-in sheet at the door, type it in weekly and keep the paper.
If you record start and end times instead, add Start and End columns (I and J, formatted as times) and put this in G2, filled down. It rounds to the nearest quarter hour and handles sessions that run past midnight:
=IF(OR(I2="", J2=""), "", ROUND(MOD(J2-I2, 1)*24*4, 0)/4)
If your program doesn't count breaks, travel or training toward service hours, leave them out of the times. Whatever you decide, apply it the same way for everyone and say so if asked.
Step 2: a Requests tab, one row per letter
Add a tab named Requests. Each time someone asks for a letter, add a row:
| Col | Header | What goes in it |
|---|---|---|
| A | Volunteer | Their name, as on the Hours tab |
| B | Volunteer ID | Optional; if both tabs have IDs, the ID is what matches |
| C | Optional: matches the Hours tab's Email when both are filled in, and is where the PDF goes if you turn emailing on | |
| D | Addressed to | Optional: “Counseling office, Central High School”. Blank prints “To whom it may concern”. |
| E | Purpose | Optional: completes the sentence “...on 12 separate days, for the school's service-hour requirement.” Keep it general; the letter doesn't need case numbers or why someone was asked to serve. |
| F, G | From, To | The period the letter covers, as dates. Blank From means from their first day; blank To means up to today. |
| H | Required hours | Optional: the target they have to meet. The letter then says “This meets the 40 hours required” or how many remain. |
| I | Verified hours so far | Formula (Step 3); the script ignores it |
The script adds three columns of its own the first time it runs, Letter (the PDF link), Hours on letter and Made at, and skips any request whose Letter cell is filled in. To make a corrected letter, clear that cell and run it again; the new PDF replaces the old one in the folder.
Step 3: verified hours as you type, and checks before you sign
In Requests!I2, filled down, the verified hours for that person and period, using the same rules as the script (name match only; use the ID columns instead of A and C if you have them):
=IF(A2="", "", SUMIFS(Hours!$G:$G, Hours!$C:$C, A2, Hours!$H:$H, TRUE, Hours!$A:$A, ">=" & IF(F2="", DATE(1900,1,1), F2), Hours!$A:$A, "<=" & IF(G2="", TODAY(), G2)))
SUMIFS only adds a row when every condition matches, which is what you want here: right person, verified, inside the dates. This version counts only ticked checkboxes; if you use initials in Verified, replace TRUE with "<>" (counts any non-blank cell, so write “Pending” only if you also exclude it). Compare I with the Required hours before you promise anyone a letter.
Three rules on the Hours tab (select A2:H, Format › Conditional formatting › Custom formula is) catch the usual problems:
| Custom formula | Color | Meaning |
|---|---|---|
=AND($A2<>"", $A2<TODAY()-7, $H2<>TRUE) | Amber | Served over a week ago and still not verified (use $H2="" if you use initials) |
=AND($C2<>"", COUNTIFS($A:$A, $A2, $C:$C, $C2, $E:$E, $E2, $G:$G, $G2)>1) | Red | Same person, day, activity and hours twice: probably typed in twice |
=AND($A2<>"", OR(N($G2)<=0, N($G2)>24)) | Red | Hours missing or impossible |
The script reports the same things by row number when it runs, so nothing doubtful goes on a letter without you seeing it first.
Step 4: the script (one PDF letter per request)
Create a Drive folder for the letters and copy its ID (the part of the folder's URL after /folders/). Open Extensions › Apps Script, paste the script below, and set FOLDER_ID, ORG_NAME, ORG_LINES (address, phone and email; they print as the letterhead), SIGNER_NAME, SIGNER_TITLE and SIGNER_CONTACT. Add ORG_EIN if the schools or courts you deal with ask for your tax ID. Then:
- Reload the spreadsheet and run Volunteer hours › Make verification letters, approving the permissions the first time.
PREVIEWistrue, so it makes at most 3 PDFs named “PREVIEW ...”, emails nobody and writes nothing back. - Open the previews and check them against the sheet: name, dates, total, activities. Delete them when you're happy.
- Set
PREVIEW = false, save and run it again. It makes one PDF per open request and fills in Letter, Hours on letter and Made at. If there are more thanMAX_PER_RUN(25), run it again; finished requests are skipped.
// Volunteer hours verification letters from a Google Sheets hours log: one PDF letter per request,
// with the volunteer's verified hours for the dates asked for, what they did, a dated log of each
// day served and a signature block for the person who supervised them.
// Sheet: an Hours tab (Date, Volunteer or Name, Hours, plus optional Volunteer ID, Email, Activity
// or Role, Supervisor, Verified, Status) and a Requests tab, one row per letter asked for
// (Volunteer or Name, plus optional Volunteer ID, Email, Addressed to, Purpose, From, To,
// Required hours). The script only reads the Hours tab. On the Requests tab it fills in three
// columns of its own: Letter, Hours on letter and Made at.
const FOLDER_ID = 'PASTE_DRIVE_FOLDER_ID'; // Drive folder for the PDFs
const HOURS_SHEET = 'Hours'; // or 'Signups' if you use the volunteer shift guide
const REQUESTS_SHEET = 'Requests';
const ORG_NAME = 'Your organization name';
const ORG_LINES = ['Street address', 'City, State ZIP', 'Phone', 'volunteer@yourorg.example']; // printed under the name
const ORG_EIN = ''; // optional, e.g. '12-3456789'; some schools and courts ask
const SIGNER_NAME = 'Name'; // the person who signs: someone who can vouch for the hours
const SIGNER_TITLE = 'Volunteer Coordinator';
const SIGNER_CONTACT = 'Phone or email for verification';
const LIST_EACH_DAY = true; // true = a dated table of every day served
const COUNTED_STATUSES = ['attended', 'completed', 'verified', 'approved', 'done', 'yes'];
const EMAIL_LETTERS = false; // true = email each PDF to the request's Email
const PREVIEW = true; // true = at most 3 PDFs named "PREVIEW ...", emails only to you, nothing written back
const REPLY_TO = ''; // optional reply-to address for emails
const MAX_PER_RUN = 25; // run again to continue; finished requests are skipped
const MAX_MINUTES = 4.5; // stop before Apps Script's 6-minute limit
const KEEP_DOCS = false; // false = keep only the PDF, not the Google Doc
const DAY = 86400000;
const MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September',
'October', 'November', 'December'];
function onOpen() {
SpreadsheetApp.getUi().createMenu('Volunteer hours')
.addItem('Make verification letters', 'makeHoursLetters')
.addToUi();
}
function makeHoursLetters(now) {
let ui = null;
if (!(now instanceof Date)) { // run from the menu or a trigger
now = new Date();
try { ui = SpreadsheetApp.getUi(); } catch (e) { ui = null; } // no UI when a trigger runs it
}
const lock = LockService.getDocumentLock();
if (!lock.tryLock(30000)) return; // another run is still busy
try {
const result = run_(now, Date.now());
if (ui) ui.alert(summary_(result));
return result;
} finally {
lock.releaseLock();
}
}
function run_(now, startedMs) {
const ss = SpreadsheetApp.getActive();
const tz = ss.getSpreadsheetTimeZone();
const today = dayNum_(Utilities.formatDate(now, tz, 'yyyy-MM-dd'));
const hoursSheet = ss.getSheetByName(HOURS_SHEET);
if (!hoursSheet) throw new Error('No tab named ' + HOURS_SHEET + '.');
const reqSheet = ss.getSheetByName(REQUESTS_SHEET);
if (!reqSheet) throw new Error('No tab named ' + REQUESTS_SHEET + '.');
const log = readHours_(hoursSheet.getDataRange().getValues(), tz, today);
const reqValues = reqSheet.getDataRange().getValues();
const req = readRequests_(reqValues, tz);
const res = { preview: PREVIEW, made: 0, emailed: 0, alreadyDone: 0, left: 0, quota: false, timeUp: false,
noHours: [], short: [], notCounted: [], noEmail: [], skippedRows: log.skipped, badRequests: req.skipped,
duplicates: log.duplicates, pdfs: [] };
const todo = req.list.filter(function (r) {
if (!PREVIEW && r.done) { res.alreadyDone++; return false; }
return true;
});
if (!todo.length) return res;
let cols = null; // Letter / Hours on letter / Made at, added if missing
const folder = DriveApp.getFolderById(FOLDER_ID);
const me = Session.getEffectiveUser().getEmail();
const limit = PREVIEW ? Math.min(3, MAX_PER_RUN) : MAX_PER_RUN;
for (let i = 0; i < todo.length; i++) {
const r = todo[i];
if (res.made >= limit) { res.left = todo.length - i; break; }
if (Date.now() - startedMs > MAX_MINUTES * 60000) { res.left = todo.length - i; res.timeUp = true; break; }
const v = collect_(r, log.rows, today);
if (v.notCounted) res.notCounted.push(r.name + ': ' + hrs_(v.notCounted) + ' hours not verified, left out');
if (!v.days.length) { res.noHours.push(r.name + ' (Requests row ' + r.row + ')'); continue; }
if (r.required && v.total < r.required * 100) res.short.push(r.name + ': ' + hrs_(v.total) + ' of ' + hrs_(r.required * 100) + ' hours');
const emails = EMAIL_LETTERS ? emails_(r.email) : null;
const to = emails ? (PREVIEW ? [me] : emails) : [];
if (to.length && MailApp.getRemainingDailyQuota() < to.length) {
res.left = todo.length - i; res.quota = true; break; // tomorrow's run continues here
}
const made = makePdf_(folder, r, v, today, PREVIEW ? 'PREVIEW ' : '');
res.made++;
res.pdfs.push(made.url);
if (EMAIL_LETTERS && !emails) res.noEmail.push(r.name);
if (to.length) {
MailApp.sendEmail(mail_(r, v, made.blob, to, emails));
res.emailed++;
}
if (!PREVIEW) {
if (!cols) cols = outputColumns_(reqSheet, reqValues[0]);
reqSheet.getRange(r.row, cols.letter + 1).setValue(made.url);
reqSheet.getRange(r.row, cols.hours + 1).setValue(v.total / 100);
reqSheet.getRange(r.row, cols.madeAt + 1).setValue(Utilities.formatDate(now, tz, 'yyyy-MM-dd HH:mm') +
(to.length ? ', emailed to ' + emails.join(', ') : ''));
SpreadsheetApp.flush(); // the link survives even if a later letter fails
}
}
return res;
}
function readHours_(values, tz, today) {
const col = finder_(values[0]);
const c = { date: col('Date'), name: either_(col, 'Volunteer', 'Name'), id: col('Volunteer ID'), email: col('Email'),
hours: col('Hours'), activity: either_(col, 'Activity', 'Role'), sup: col('Supervisor'),
verified: col('Verified'), status: col('Status') };
if (c.date < 0 || c.name < 0 || c.hours < 0) {
throw new Error('The ' + HOURS_SHEET + ' tab needs Date, Volunteer (or Name) and Hours columns in its first row.');
}
const rows = [], skipped = [], seen = {}, duplicates = [];
for (let i = 1; i < values.length; i++) {
const v = values[i], n = i + 1;
const get = function (k) { return c[k] < 0 || v[c[k]] == null ? '' : v[c[k]]; };
const name = String(get('name')).trim();
if (!name && String(get('hours')).trim() === '' && String(get('date')).trim() === '') continue; // empty row
const day = toDay_(get('date'), tz);
if (day === null) { skipped.push('Hours row ' + n + ': Date is not a date'); continue; }
if (!name) { skipped.push('Hours row ' + n + ': no volunteer name'); continue; }
const h = number_(get('hours'));
if (isNaN(h)) { skipped.push('Hours row ' + n + ': Hours is not a number'); continue; }
if (h <= 0 || h > 24) { skipped.push('Hours row ' + n + ': Hours must be more than 0 and at most 24'); continue; }
if (day > today) continue; // a future shift: not served yet
const status = String(get('status')).trim().toLowerCase();
const ver = get('verified');
const verText = String(ver).trim().toLowerCase();
const counted = (c.status < 0 || COUNTED_STATUSES.indexOf(status) >= 0) &&
(c.verified < 0 || ver === true || (verText !== '' && ['no', 'n', 'false', 'pending', '0'].indexOf(verText) < 0));
const row = { row: n, day: day, name: name, key: norm_(name), id: norm_(get('id')), email: String(get('email')).trim().toLowerCase(),
cents: Math.round(h * 100), activity: String(get('activity')).trim(), sup: String(get('sup')).trim(), counted: counted };
if (counted) {
const k = [row.id || row.key, day, row.cents, row.activity.toLowerCase()].join('|');
if (seen[k]) duplicates.push('Hours rows ' + seen[k] + ' and ' + n + ': same volunteer, date, hours and activity');
else seen[k] = n;
}
rows.push(row);
}
return { rows: rows, skipped: skipped, duplicates: duplicates };
}
function readRequests_(values, tz) {
const col = finder_(values[0]);
const c = { name: either_(col, 'Volunteer', 'Name'), id: col('Volunteer ID'), email: col('Email'), to: col('Addressed to'),
purpose: col('Purpose'), from: col('From'), until: col('To'), required: col('Required hours'), letter: col('Letter') };
if (c.name < 0 && c.id < 0) throw new Error('The ' + REQUESTS_SHEET + ' tab needs a Volunteer (or Name) or Volunteer ID column.');
const list = [], skipped = [];
for (let i = 1; i < values.length; i++) {
const v = values[i], n = i + 1;
const get = function (k) { return c[k] < 0 || v[c[k]] == null ? '' : v[c[k]]; };
const name = String(get('name')).trim(), id = String(get('id')).trim();
if (!name && !id) continue;
const fromSet = String(get('from')).trim() !== '', untilSet = String(get('until')).trim() !== '';
const from = fromSet ? toDay_(get('from'), tz) : null; // blank From = from the first day served
const until = untilSet ? toDay_(get('until'), tz) : null; // blank To = up to today
if ((fromSet && from === null) || (untilSet && until === null)) { skipped.push('Requests row ' + n + ': From or To is not a date'); continue; }
if (from !== null && until !== null && from > until) { skipped.push('Requests row ' + n + ': From is after To'); continue; }
const reqText = String(get('required')).trim();
const required = reqText === '' ? 0 : number_(reqText);
if (isNaN(required) || required < 0) { skipped.push('Requests row ' + n + ': Required hours is not a number'); continue; }
list.push({ row: n, name: name || id, key: norm_(name), id: norm_(id), email: String(get('email')).trim(),
addressedTo: String(get('to')).trim(), purpose: String(get('purpose')).trim(), from: from, until: until,
required: required, done: String(get('letter')).trim() !== '' });
}
return { list: list, skipped: skipped };
}
// The hours that belong on one letter: same volunteer, inside the dates asked for, counted rows only.
function collect_(r, rows, today) {
const email = r.email.toLowerCase();
const mine = rows.filter(function (x) {
if (r.id && x.id) return r.id === x.id;
if (email && x.email) return email === x.email;
return r.key !== '' && r.key === x.key;
}).filter(function (x) {
return (r.from === null || x.day >= r.from) && (r.until === null || x.day <= r.until);
});
const days = mine.filter(function (x) { return x.counted; })
.sort(function (a, b) { return a.day - b.day || a.row - b.row; });
const total = days.reduce(function (s, x) { return s + x.cents; }, 0);
const notCounted = mine.filter(function (x) { return !x.counted; }).reduce(function (s, x) { return s + x.cents; }, 0);
const acts = {}, order = [];
days.forEach(function (x) {
const a = x.activity || 'Volunteer service';
if (!(a.toLowerCase() in acts)) { acts[a.toLowerCase()] = { name: a, cents: 0 }; order.push(a.toLowerCase()); }
acts[a.toLowerCase()].cents += x.cents;
});
const dates = {};
days.forEach(function (x) { dates[x.day] = true; });
return { days: days, total: total, notCounted: notCounted, dayCount: Object.keys(dates).length,
first: days.length ? days[0].day : null, last: days.length ? days[days.length - 1].day : null,
activities: order.map(function (k) { return acts[k]; }).sort(function (a, b) { return b.cents - a.cents; }),
name: r.name, today: today };
}
function outputColumns_(sheet, header) {
const h = (header || []).map(function (x) { return String(x).trim().toLowerCase(); });
let width = h.length;
while (width > 0 && h[width - 1] === '') width--;
const out = {};
[['letter', 'Letter'], ['hours', 'Hours on letter'], ['madeAt', 'Made at']].forEach(function (p) {
let i = h.indexOf(p[1].toLowerCase());
if (i < 0) { i = width++; sheet.getRange(1, i + 1).setValue(p[1]); }
out[p[0]] = i;
});
return out;
}
function makePdf_(folder, r, v, today, prefix) {
const name = prefix + 'Volunteer hours - ' + r.name.replace(/[\\\/:*?"<>|]/g, '-') + ' - ' +
iso_(r.from === null ? v.first : r.from) + ' to ' + iso_(r.until === null ? today : r.until);
const old = folder.getFilesByName(name + '.pdf');
while (old.hasNext()) old.next().setTrashed(true); // a re-made letter replaces the old PDF
const doc = DocumentApp.create(name);
const file = DriveApp.getFileById(doc.getId());
file.moveTo(folder);
render_(doc.getBody(), r, v, today);
doc.saveAndClose();
const blob = file.getAs('application/pdf').setName(name + '.pdf');
const pdf = folder.createFile(blob);
if (!KEEP_DOCS) file.setTrashed(true);
return { name: name, blob: blob, url: pdf.getUrl() };
}
function render_(body, r, v, today) {
const H = DocumentApp.ParagraphHeading;
body.setMarginTop(54).setMarginBottom(54).setMarginLeft(54).setMarginRight(54);
const first = body.getParagraphs()[0];
first.setText(ORG_NAME);
first.setHeading(H.HEADING1);
ORG_LINES.concat(ORG_EIN ? ['EIN ' + ORG_EIN] : []).forEach(function (line) { body.appendParagraph(line).setHeading(H.NORMAL); });
body.appendParagraph(show_(today)).setHeading(H.NORMAL);
body.appendParagraph(r.addressedTo || 'To whom it may concern').setHeading(H.NORMAL);
body.appendParagraph('Verification of volunteer hours: ' + r.name).setHeading(H.HEADING2);
const span = v.first === v.last ? 'on ' + show_(v.first) : 'between ' + show_(v.first) + ' and ' + show_(v.last);
body.appendParagraph('This letter confirms that ' + r.name + ' completed ' + hrs_(v.total) + ' hours of volunteer service with ' +
ORG_NAME + ' ' + span + ', on ' + v.dayCount + (v.dayCount === 1 ? ' day' : ' separate days') +
(r.purpose ? ', for ' + r.purpose : '') + '. The hours are taken from our volunteer attendance records' +
(r.from !== null || r.until !== null ? ' for ' + period_(r, today) : '') + '.').setHeading(H.NORMAL);
if (r.required) {
body.appendParagraph(v.total >= r.required * 100
? 'This meets the ' + hrs_(r.required * 100) + ' hours required.'
: 'This is ' + hrs_(v.total) + ' of the ' + hrs_(r.required * 100) + ' hours required; ' +
hrs_(r.required * 100 - v.total) + ' hours remain.').setHeading(H.NORMAL);
}
body.appendParagraph('Service performed').setHeading(H.HEADING3);
const acts = [['Activity', 'Hours']];
v.activities.forEach(function (a) { acts.push([a.name, hrs_(a.cents)]); });
table_(body, acts, [1]);
if (LIST_EACH_DAY) {
body.appendParagraph('Dates of service').setHeading(H.HEADING3);
const showSup = v.days.some(function (x) { return x.sup; });
const rows = [showSup ? ['Date', 'Activity', 'Supervisor', 'Hours'] : ['Date', 'Activity', 'Hours']];
v.days.forEach(function (x) {
const a = x.activity || 'Volunteer service';
rows.push(showSup ? [show_(x.day), a, x.sup, hrs_(x.cents)] : [show_(x.day), a, hrs_(x.cents)]);
});
rows.push(showSup ? ['Total', '', '', hrs_(v.total)] : ['Total', '', hrs_(v.total)]);
table_(body, rows, [rows[0].length - 1]).getRow(rows.length - 1).editAsText().setBold(true);
}
body.appendParagraph('To confirm these hours, contact ' + SIGNER_NAME + ', ' +
SIGNER_TITLE + ', at ' + SIGNER_CONTACT + '.').setHeading(H.NORMAL);
body.appendParagraph('Sincerely,').setHeading(H.NORMAL);
body.appendParagraph('').setHeading(H.NORMAL);
body.appendParagraph('______________________________').setHeading(H.NORMAL);
body.appendParagraph(SIGNER_NAME + ', ' + SIGNER_TITLE).setHeading(H.NORMAL);
body.appendParagraph(ORG_NAME).setHeading(H.NORMAL);
}
function period_(r, today) {
if (r.from !== null && r.until !== null) return show_(r.from) + ' to ' + show_(r.until);
if (r.from !== null) return show_(r.from) + ' to ' + show_(today);
return 'the period up to ' + show_(r.until);
}
function table_(body, cells, rightCols) {
const t = body.appendTable(cells);
t.getRow(0).editAsText().setBold(true);
for (let r = 0; r < cells.length; r++) {
rightCols.forEach(function (c) {
t.getCell(r, c).getChild(0).asParagraph().setAlignment(DocumentApp.HorizontalAlignment.RIGHT);
});
}
return t;
}
function mail_(r, v, blob, to, emails) {
const m = {
to: to.join(','),
subject: (PREVIEW ? '[PREVIEW to ' + emails.join(', ') + '] ' : '') + 'Your volunteer hours letter from ' + ORG_NAME,
body: 'Hello ' + r.name + ',\n\nAttached is the letter confirming your ' + hrs_(v.total) + ' volunteer hours with ' + ORG_NAME +
'. If the place you are sending it to needs a signed paper copy or its own form, just reply and we will sign it.\n\n' +
'Thank you for your time.\n\n' + SIGNER_NAME + '\n' + SIGNER_TITLE + ', ' + ORG_NAME,
name: ORG_NAME,
attachments: [blob]
};
if (REPLY_TO) m.replyTo = REPLY_TO;
return m;
}
function summary_(r) {
const out = [(r.preview ? 'PREVIEW: ' : '') + r.made + ' verification letter PDF(s) made.' +
(r.emailed ? ' Emailed ' + r.emailed + (r.preview ? ' (to you only).' : '.') : '')];
if (r.alreadyDone) out.push(r.alreadyDone + ' request(s) already have a letter (clear the Letter cell to make it again).');
if (r.left) out.push(r.left + ' request(s) left' + (r.quota ? ' (daily email quota reached)' : r.timeUp ? ' (time limit)' : '') + '. Run it again to continue.');
if (r.short.length) out.push('Below the required hours (the letter says how many remain):\n' + r.short.join('\n'));
if (r.notCounted.length) out.push('Hours in the log that are not verified yet:\n' + r.notCounted.join('\n'));
if (r.noHours.length) out.push('No verified hours found, no letter made: ' + r.noHours.join(', '));
if (r.noEmail.length) out.push('No valid Email, PDF made but not sent: ' + r.noEmail.join(', '));
if (r.duplicates.length) out.push('Possible double entries, check them:\n' + r.duplicates.slice(0, 10).join('\n'));
const bad = r.badRequests.concat(r.skippedRows);
if (bad.length) out.push('Rows skipped:\n' + bad.slice(0, 15).join('\n') + (bad.length > 15 ? '\n...and ' + (bad.length - 15) + ' more' : ''));
return out.join('\n\n');
}
// ---- small helpers ----
function finder_(header) {
const h = (header || []).map(function (x) { return String(x).trim().toLowerCase(); });
return function (name) { return h.indexOf(name.toLowerCase()); };
}
function either_(col, a, b) {
return col(a) >= 0 ? col(a) : col(b);
}
function norm_(s) {
return String(s || '').trim().replace(/\s+/g, ' ').toLowerCase();
}
function emails_(s) {
const list = String(s || '').split(/[,;]/).map(function (x) { return x.trim(); }).filter(String);
const ok = list.length > 0 && list.every(function (x) { return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(x); });
return ok ? list : null;
}
function number_(s) {
if (typeof s === 'number') return s;
const t = String(s).replace(/\s/g, '').replace(/,/g, '.');
return /^\d+(\.\d+)?$/.test(t) ? Number(t) : NaN;
}
function toDay_(v, tz) {
if (v instanceof Date) return isNaN(v.getTime()) ? null : dayNum_(Utilities.formatDate(v, tz, 'yyyy-MM-dd'));
return typeof v === 'string' ? dayNum_(v.trim()) : null;
}
// Dates are whole days counted from 1970-01-01, so time zones and daylight saving can't shift them.
function dayNum_(s) {
const m = /^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(String(s));
if (!m) return null;
const n = Date.UTC(+m[1], +m[2] - 1, +m[3]) / DAY;
const back = ymd_(n);
return back.y === +m[1] && back.m === +m[2] && back.d === +m[3] ? n : null;
}
function ymd_(n) {
const d = new Date(n * DAY);
return { y: d.getUTCFullYear(), m: d.getUTCMonth() + 1, d: d.getUTCDate() };
}
function show_(n) {
const t = ymd_(n);
return MONTHS[t.m - 1] + ' ' + t.d + ', ' + t.y;
}
function iso_(n) {
const t = ymd_(n);
return t.y + '-' + String(t.m).padStart(2, '0') + '-' + String(t.d).padStart(2, '0');
}
// Hours are kept in hundredths so 2.25 + 1.5 adds up exactly; shown without trailing zeros.
function hrs_(cents) {
return String(Math.round(cents) / 100);
}
What the script does
- The letter. Your organization's name and contact lines, the date, who it's addressed to, a subject line naming the volunteer, then one sentence with the facts: total hours, first and last date served, the number of separate days, and the purpose if you gave one. With Required hours it adds whether the target is met. A table of activities with hours each (most first), a dated table of every day served with activity, supervisor (if any) and hours, and a bold total. It closes with who to contact to confirm the hours and a blank signature line above the signer's name and title.
- Only verified hours, only the dates asked for. A row counts when it is inside From and To, not in the future, and marked verified. Rows for that person that aren't verified yet are left off the letter and listed in the summary (“4 hours not verified, left out”), so you can chase the supervisor before you send it. Hours are added in hundredths, so 2.25 + 1.5 is exactly 3.75.
- One person, however they were typed. Rows are matched by Volunteer ID when both sides have one, otherwise by Email when both have one, otherwise by name ignoring capitals and extra spaces.
- Problems are reported, not guessed. The summary lists rows with a date that isn't a date, hours that aren't a number or are over 24, no name, likely double entries (same person, day, hours and activity; counted, but flagged so you can check), requests with From after To, and requests with no verified hours at all (no letter is made for those).
- Safe to run again. Requests with a Letter link are skipped. A document lock stops two runs overlapping, the link is saved after each letter, and it stops after 4.5 minutes so it never hits Apps Script's 6-minute limit mid-letter.
- Read-only on your hours. It never changes the Hours tab; it only writes the three output columns on Requests.
- PDF only, unless you want the Doc. It builds each letter in a temporary Google Doc, saves the PDF to your folder and moves the Doc to the trash. Set
KEEP_DOCS = trueto keep the Docs and edit one by hand, for example to add a sentence about the volunteer for a scholarship letter.LIST_EACH_DAY = falseleaves out the dated table for a one-page letter.
Step 5: using the volunteer shift guide's Signups tab
If you schedule with the volunteer shift guide, you already have the hours: its Signups tab has Name, Email, Status and the Date, Role and Hours helper columns. Set HOURS_SHEET = 'Signups'. The script reads Name as the volunteer and Role as the activity, and when a Status column is present it counts only rows marked Attended (or Completed, Verified, Approved, Done), so No-show, Cancelled, Waitlist and shifts not yet marked are left out. Marking Attended after each shift is then your verification step.
Step 6: signing and sending
A letter is only as good as its signature. The simplest routine: print the PDF, have the signer sign it in ink, and scan it or hand it over. If your organization signs PDFs electronically, that works too, as long as the school or court accepts it; ask them. Many places will contact the signer to confirm, so SIGNER_CONTACT should be a phone number or address someone actually answers.
To email the unsigned PDF to the volunteer instead (useful when the receiving office only needs the record, or for the volunteer's own files), set EMAIL_LETTERS = true. Each PDF goes to the request's Email from your account with ORG_NAME as the sender name, and the message offers a signed copy on request; replies go to REPLY_TO if set. Try it with PREVIEW = true first: preview emails come only to you, with the real recipient in the subject. The script checks your remaining daily Apps Script email quota before each email (100 recipients a day on a consumer Gmail account, 1,500 on Google Workspace) and stops when it would run out; the next run carries on.
Tips
- Ask what they need first. A required form, a minimum number of hours, approved kinds of service, a deadline, whether the signature must be wet ink or notarized: one question up front saves remaking the letter.
- Year-end and graduation rushes. Requests pile up before school deadlines and at year end. Run the script once a week and the letters are waiting; the Verified hours so far column tells you who is close to their target.
- Annual hours summaries. The same tabs give you totals for grant reports or volunteer recognition:
=QUERY(Hours!A1:H, "select C, sum(G), count(G) where H = true group by C order by sum(G) desc label sum(G) 'Verified hours', count(G) 'Days'", 1). - Keep it private. Hours logs and letters are personal records, and some people serve hours they would rather not explain. Share the sheet and the letter folder only with the coordinators who need them, keep case details out of the sheet, and don't put the sheet's link in emails (the script doesn't).
- Minors. If young volunteers ask for letters, follow your organization's rules on contacting them and their parents; emailing the letter to a parent's address may be the right default.
- Ownership. Run the script from a shared organization account, not one coordinator's personal one, so the letters and the emails outlast any one person in the role.
{{Volunteer}}, {{Verified hours so far}}, {{From}}, {{To}}, {{Purpose}} and any other column. For the day-by-day table, use the script above. 14-day free trial, no credit card to start. SheetWeave is on the Google Workspace Marketplace.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
- 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
- Class rosters: one PDF per class, A–Z, with seat counts
- 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, Google Docs, Google Drive and Apps Script as they worked on November 16, 2026, and to the US Courts and Google pages cited as they stood that day. Not legal advice, and not affiliated with Google, any court or any school. Google Sheets, Google Docs and Google Drive are trademarks of Google LLC. Check each letter against your own records before anyone signs it. Questions or corrections: hello@loomwise.app.