Guides

Free Jira timesheet template for Google Sheets

Last verified 31 October 2026Jira Cloud · 4 min read

Short answer. Copy the template, connect it to Jira Cloud from its menu, and choose Get worklogs. The Timesheet tab then shows hours per person per day for any week, and By person shows hours and amounts for any dates. It is free, and Jira data stays between Atlassian and your Google account.

Get the template

Make a copy in Google Sheets

Google opens a copy in your own Drive, script included. The copy belongs to you; we can't see it.

What is in it

TabWhat it shows
Start hereThree steps to connect it, with your Jira site and dates in step 1, and links to every tab.
TimesheetHours per person per day for the 7 days from a date you pick, with weekends shaded and a total per person and per day.
By personHours per person between the dates on Start here, with each rate and the amount. A missing rate shows in amber.
WorklogsOne row per worklog: date, person, work item key, summary and hours. The script fills it.
RatesAn hourly rate per person, typed by you.
Jira timesheetTimesheet tab
1PersonMon 5Tue 6Wed 7Thu 8Fri 9Total
2Alex Rivera3.585.752.752.500.7515.33
3Priya Nair3.502.581.005.753.0015.83
4Sam Okafor0.835.005.503.252.5017.08
5Total7.9213.339.2511.506.2548.25

Fill it from your Jira

Jira Cloudworklog API
Get worklogsscript in your copy
Worklogsone row each
Timesheetper person, per day
By personhours × Rates
The script only fetches. Everything after the Worklogs tab is ordinary formulas you can read and change.
  1. On Start here, fill in step 1: your Jira site, such as https://yourcompany.atlassian.net, and the first and last day you want.
  2. Choose Jira timesheet → Connect to Jira and enter the email you sign in to Jira with and an API token. Make the token at id.atlassian.com → Security → API tokens; it is saved in your Google account, not in the spreadsheet, so people you share the spreadsheet with can't see it.
  3. Choose Jira timesheet → Get worklogs. The first time, Google asks you to allow the script. It warns that Google hasn't verified it, because the script is your own copy rather than a published app: choose Advanced, then Go to the project, then Allow.
  4. Worklogs fills with every worklog between your dates. Change the date at the top of Timesheet to see any other week, and add rates on Rates for the amounts on By person.

You see the worklogs your Jira account may see. For the whole team, the account needs Browse projects on the projects and permission to see everyone's worklogs.

The formulas, to build your own

Three formulas do the work, all reading a Worklogs tab with Date in column A, Person in B and Hours in E. The people who logged time that week:

Timesheet!A6, with the week's first day in B2
=IFERROR(SORT(UNIQUE(FILTER(Worklogs!B2:B, Worklogs!B2:B<>"", Worklogs!A2:A>=$B$2, Worklogs!A2:A<$B$2+7))), "")

One person's hours on one day, with the person in column A and the date in row 3:

Timesheet!B6, filled across and down, with the dates in row 4
=IF($A6="", "", SUMIFS(Worklogs!$E:$E, Worklogs!$B:$B, $A6, Worklogs!$A:$A, B$4))

Hours between two dates, for an invoice or a monthly total:

By person!B6, filled down, with the dates in cells named FromDate and ToDate
=SUMIFS(Worklogs!$E:$E, Worklogs!$B:$B, $A6, Worklogs!$A:$A, ">="&FromDate, Worklogs!$A:$A, "<="&ToDate)

A pivot table gets you most of the way too: rows = Person, columns = Date, values = SUM of Hours. In Excel, FILTER, UNIQUE and SORT work in Microsoft 365 and Excel 2021 or later.

Limits

  • It refreshes when you ask. For a daily refresh, open Extensions → Apps Script → Triggers and add a time-driven trigger for getWorklogs. Nothing tells you if that trigger fails unless you turn on Apps Script's failure notifications.
  • Apps Script stops a run after 6 minutes. A few months of worklogs for a team fits; years of history on a large site may not.
  • No billing rules. Amounts are exact hours times the rate. Rounding up to 6 or 15 minutes and billable flags are in the invoicing guide.
  • Tempo: if your team logs time through Tempo, Jira often credits those worklogs to the Tempo app instead of the person.
  • Names, not accounts. Two people with the same display name are added together.

For a timesheet that refreshes itself every morning, with rounding, billable hours and an email when a refresh fails, see the timesheet by user guide, which compares the options, including ours.

The script inside

This is the whole script in the template, so you can read what it does before you run it. It calls only your Jira site, writes only to this spreadsheet, and keeps your token in your own Google account.

Code.gs
// Jira timesheet template for Google Sheets, from cellmason.com/jira/guides. Free to use and change.
// Jira timesheet → Connect to Jira saves your login; Get worklogs fills the Worklogs tab for the
// dates on Start here. Timesheet and By person are formulas over the Worklogs tab.

/** @OnlyCurrentDoc */

const COLOR = {
  ink: '#1a1918', soft: '#57534e', faint: '#77726a', line: '#e3dfd7',
  paper: '#faf9f6', fill: '#f2f0eb', brick: '#b5451b', amber: '#f8eedc',
};

function onOpen() {
  SpreadsheetApp.getUi()
    .createMenu('Jira timesheet')
    .addItem('Connect to Jira', 'connect')
    .addItem('Get worklogs', 'getWorklogs')
    .addToUi();
}

function connect() {
  const ui = SpreadsheetApp.getUi();
  const email = ui.prompt('Connect to Jira', 'The email you sign in to Jira with:', ui.ButtonSet.OK_CANCEL);
  if (email.getSelectedButton() !== ui.Button.OK) return;
  const token = ui.prompt('Connect to Jira', 'An API token from id.atlassian.com → Security → API tokens:', ui.ButtonSet.OK_CANCEL);
  if (token.getSelectedButton() !== ui.Button.OK) return;
  // Kept in your own Google account, not in the spreadsheet, so people you share it with can't see it.
  PropertiesService.getUserProperties().setProperties({
    JIRA_EMAIL: email.getResponseText().trim(),
    JIRA_TOKEN: token.getResponseText().trim(),
  });
  ui.alert('Saved. Now choose Jira timesheet → Get worklogs.');
}

function getWorklogs() {
  const book = SpreadsheetApp.getActive();
  const zone = book.getSpreadsheetTimeZone();
  const site = String(book.getRangeByName('JiraSite').getValue()).trim().replace(/\/+$/, '');
  const from = asDay(book.getRangeByName('FromDate').getValue(), zone);
  const to = asDay(book.getRangeByName('ToDate').getValue(), zone);
  const props = PropertiesService.getUserProperties();
  const email = props.getProperty('JIRA_EMAIL');
  const token = props.getProperty('JIRA_TOKEN');
  if (!email || !token) throw new Error('Choose Jira timesheet → Connect to Jira first.');
  if (!/^https:\/\/[^/]+$/.test(site)) throw new Error('Put your Jira site in step 1 on Start here, like https://yourcompany.atlassian.net');
  const isDay = (day) => /^\d{4}-\d{2}-\d{2}$/.test(day);
  if (!isDay(from) || !isDay(to) || from > to) throw new Error('Step 1 on Start here needs a From date on or before the To date.');

  const auth = 'Basic ' + Utilities.base64Encode(email + ':' + token);
  const call = (path, body) => {
    const options = { headers: { Authorization: auth, Accept: 'application/json' }, muteHttpExceptions: true };
    if (body) Object.assign(options, { method: 'post', contentType: 'application/json', payload: JSON.stringify(body) });
    const response = UrlFetchApp.fetch(path.startsWith('http') ? path : site + path, options);
    const code = response.getResponseCode();
    if (code === 401) throw new Error('Jira rejected the email or API token. Choose Jira timesheet → Connect to Jira and enter them again.');
    if (code === 404) throw new Error('No Jira Cloud site answered at ' + site + '. Check the site in step 1 on Start here.');
    if (code >= 300) throw new Error('Jira answered ' + code + ': ' + response.getContentText().slice(0, 200));
    return JSON.parse(response.getContentText());
  };

  // 1. Ids of every worklog added or changed since a week before From, 1,000 per page.
  //    (Asking for changed worklogs catches time logged late; the week covers time logged a little early.)
  const since = new Date(from + 'T00:00:00Z').getTime() - 7 * 24 * 3600 * 1000;
  const ids = [];
  let page = call('/rest/api/3/worklog/updated?since=' + since);
  ids.push(...page.values.map((v) => v.worklogId));
  while (!page.lastPage) {
    page = call(page.nextPage);
    ids.push(...page.values.map((v) => v.worklogId));
  }

  // 2. The worklogs, 1,000 per call. Keep those started between From and To, by the logger's own date.
  const worklogs = [];
  for (let i = 0; i < ids.length; i += 1000) {
    for (const w of call('/rest/api/3/worklog/list', { ids: ids.slice(i, i + 1000) })) {
      const day = w.started.slice(0, 10);
      if (day >= from && day <= to) worklogs.push(w);
    }
  }

  // 3. Keys and summaries of the work items, 100 per search.
  const issueIds = [...new Set(worklogs.map((w) => w.issueId))];
  const issues = {};
  for (let i = 0; i < issueIds.length; i += 100) {
    const found = call('/rest/api/3/search/jql', { jql: 'id in (' + issueIds.slice(i, i + 100).join(',') + ')', fields: ['summary'], maxResults: 100 });
    for (const issue of found.issues) issues[issue.id] = issue;
  }

  // 4. One row per worklog, oldest first, replacing what the Worklogs tab held.
  const rows = worklogs
    .map((w) => [
      w.started.slice(0, 10),
      w.author ? w.author.displayName : '',
      issues[w.issueId] ? issues[w.issueId].key : w.issueId,
      issues[w.issueId] ? issues[w.issueId].fields.summary : '',
      w.timeSpentSeconds / 3600,
    ])
    .sort((a, b) => (a[0] + a[1]).localeCompare(b[0] + b[1]));
  const sheet = book.getSheetByName('Worklogs');
  if (sheet.getLastRow() > 1) sheet.getRange(2, 1, sheet.getLastRow() - 1, 5).clearContent();
  if (sheet.getMaxRows() < rows.length + 1) sheet.insertRowsAfter(sheet.getMaxRows(), rows.length + 1 - sheet.getMaxRows());
  if (rows.length) sheet.getRange(2, 1, rows.length, 5).setValues(rows);

  book.toast('Wrote ' + rows.length + ' worklogs from ' + from + ' to ' + to + '.', 'Jira timesheet');
}

/** A date cell as YYYY-MM-DD, in the spreadsheet's time zone. */
function asDay(value, zone) {
  return value instanceof Date ? Utilities.formatDate(value, zone, 'yyyy-MM-dd') : String(value).trim();
}

/** Run once in a blank spreadsheet: lays out and styles the tabs, with made-up worklogs for last week. */
function buildTemplate() {
  const book = SpreadsheetApp.getActive();
  if (book.getSheetByName('Worklogs')) throw new Error('This spreadsheet already has the template.');
  const zone = book.getSpreadsheetTimeZone();
  const iso = (date) => Utilities.formatDate(date, zone, 'yyyy-MM-dd');
  const today = new Date();
  const monday = new Date(today.getFullYear(), today.getMonth(), today.getDate() - ((today.getDay() + 6) % 7) - 7);
  const monthStart = new Date(monday.getFullYear(), monday.getMonth(), 1);
  const monthEnd = new Date(monday.getFullYear(), monday.getMonth() + 1, 0);
  const solid = SpreadsheetApp.BorderStyle.SOLID;
  const dateRule = SpreadsheetApp.newDataValidation().requireDate().setAllowInvalid(false).setHelpText('A date. Double-click for a calendar.').build();

  // Every tab: Inter, ink-coloured text, and no rows or columns beyond the ones it uses.
  const base = (sheet, rows, columns) => {
    if (sheet.getMaxRows() > rows) sheet.deleteRows(rows + 1, sheet.getMaxRows() - rows);
    if (sheet.getMaxColumns() > columns) sheet.deleteColumns(columns + 1, sheet.getMaxColumns() - columns);
    sheet.getRange(1, 1, rows, columns).setFontFamily('Inter').setFontSize(10).setFontColor(COLOR.ink).setVerticalAlignment('middle');
    sheet.setRowHeights(1, rows, 24);
  };
  const title = (range, size) => range.setFontSize(size).setFontWeight('bold');
  const soft = (range) => range.setFontColor(COLOR.faint);
  const header = (range) => {
    range.setFontWeight('bold').setBackground(COLOR.fill).setBorder(null, null, true, null, null, null, COLOR.line, solid);
    range.getSheet().setRowHeight(range.getRow(), 30);
  };
  const input = (range) => range.setBackground('#ffffff').setBorder(true, true, true, true, null, null, COLOR.line, solid).setHorizontalAlignment('left');
  const band = (sheet, a1, firstRow) =>
    SpreadsheetApp.newConditionalFormatRule()
      .whenFormulaSatisfied('=AND($A' + firstRow + '<>"", ISEVEN(ROW()))')
      .setBackground(COLOR.paper)
      .setRanges([sheet.getRange(a1)])
      .build();
  // Text with **bold** parts, as a rich text value.
  const rich = (range, text) => {
    const bold = SpreadsheetApp.newTextStyle().setBold(true).setForegroundColor(COLOR.ink).build();
    const value = SpreadsheetApp.newRichTextValue().setText(text.replace(/\*\*/g, ''));
    let removed = 0;
    for (const match of text.matchAll(/\*\*(.+?)\*\*/g)) {
      const at = match.index - removed;
      value.setTextStyle(at, at + match[1].length, bold);
      removed += 4;
    }
    return range.setRichTextValue(value.build());
  };

  // ---- Start here: a welcome page in the brand's colours, with the settings in step 1. ----
  // Columns: margin, step number, label, value, margin. Each step is a white card on warm paper.
  const start = book.getSheets()[0].setName('Start here');
  base(start, 29, 5);
  start.setHiddenGridlines(true).setTabColor(COLOR.brick);
  start.getRange('A1:E29').setBackground(COLOR.paper);
  start.setColumnWidth(1, 28).setColumnWidth(2, 44).setColumnWidth(3, 130).setColumnWidth(4, 400).setColumnWidth(5, 28);
  const heights = { 1: 20, 2: 44, 3: 24, 4: 12, 5: 18, 10: 12, 11: 16, 15: 12, 16: 16, 19: 12, 20: 28, 26: 20, 27: 40, 28: 26, 29: 24 };
  Object.keys(heights).forEach((row) => start.setRowHeight(Number(row), heights[row]));
  const card = (a1) => start.getRange(a1).setBackground('#ffffff').setBorder(true, true, true, true, null, null, COLOR.line, solid);
  const step = (row, number, heading) => {
    start.getRange(row, 2).setValue(number).setFontColor(COLOR.brick).setFontSize(14).setFontWeight('bold').setHorizontalAlignment('center');
    title(start.getRange(row, 3).setValue(heading), 12);
    start.getRange(row, 3, 1, 2).merge();
    start.setRowHeight(row, 34);
  };
  const paragraph = (row, text, height) => {
    rich(start.getRange(row, 3), text).setFontColor(COLOR.soft).setWrap(true).setVerticalAlignment('top');
    start.getRange(row, 3, 1, 2).merge();
    start.setRowHeight(row, height);
  };
  const link = (cell, url, text) => cell.setFormula('=HYPERLINK("' + url + '", "' + text + '")').setFontColor(COLOR.brick).setFontWeight('bold');

  // Header: the title, one line on what it does, and a brick rule.
  title(start.getRange('B2').setValue('Jira timesheet'), 22);
  start.getRange('B2:D2').merge();
  start.getRange('B3').setValue('Hours per person per day, from your Jira worklogs.').setFontColor(COLOR.soft).setFontSize(11).setWrap(true);
  start.getRange('B3:D3').merge();
  start.getRange('B4:D4').setBorder(null, null, true, null, null, null, COLOR.brick, SpreadsheetApp.BorderStyle.SOLID_MEDIUM);

  // Step 1: the settings.
  card('B6:D10');
  step(6, 1, 'Tell it where your Jira is');
  start.getRange('C7:D9').setValues([
    ['Jira site', 'https://yourcompany.atlassian.net'],
    ['From', iso(monthStart)],
    ['To', iso(monthEnd)],
  ]);
  start.getRange('C7:C9').setFontColor(COLOR.soft);
  start.setRowHeights(7, 3, 30);
  input(start.getRange('D7'));
  input(start.getRange('D8')).setNumberFormat('d mmm yyyy').setDataValidation(dateRule);
  input(start.getRange('D9')).setNumberFormat('d mmm yyyy').setDataValidation(dateRule);
  book.setNamedRange('JiraSite', start.getRange('D7'));
  book.setNamedRange('FromDate', start.getRange('D8'));
  book.setNamedRange('ToDate', start.getRange('D9'));

  // Step 2: connect.
  card('B12:D15');
  step(12, 2, 'Connect to Jira');
  paragraph(13, 'Open the **Jira timesheet** menu at the top of the page, next to Help, and choose **Connect to Jira**. Enter the email you use for Jira and an API token.', 44);
  link(start.getRange('C14'), 'https://id.atlassian.com/manage-profile/security/api-tokens', 'Create an API token at id.atlassian.com  →');
  start.getRange('C14:D14').merge();

  // Step 3: fetch.
  card('B17:D19');
  step(17, 3, 'Get your worklogs');
  paragraph(18, 'Choose **Jira timesheet → Get worklogs**. Your worklogs replace the made-up ones and every tab updates by itself. Run it again whenever you want fresh numbers.', 44);

  // What's in this spreadsheet: links to each tab, filled in once the tabs exist (below).
  title(start.getRange('B21').setValue('What is in this spreadsheet'), 12);
  start.getRange('B21:D21').merge();
  start.setRowHeights(22, 4, 28);
  start.getRange('C22:D25').setBorder(null, null, true, null, null, true, COLOR.line, solid);
  start.getRange('D22:D25').setFontColor(COLOR.soft);

  paragraph(27, 'No **Jira timesheet** menu? Reload the page; it appears after a few seconds. Your API token is saved in your own Google account, never in this spreadsheet.', 40);
  link(start.getRange('C28'), 'https://cellmason.com/jira', 'Made by Cellmason. Want it refreshed every morning, with billable hours and an email when a refresh fails?  →');
  start.getRange('C28:D28').merge();
  start.getRange('C28').setFontWeight('normal');

  // ---- Worklogs: one row per worklog. Get worklogs replaces the made-up rows. ----
  const worklogs = book.insertSheet('Worklogs');
  const people = ['Ana Ruiz (sample)', 'Ben Okafor (sample)', 'Chloé Martin (sample)'];
  const items = [['WEB-101', 'Checkout page redesign'], ['WEB-114', 'Fix VAT on invoices'], ['API-27', 'Rate limit for exports']];
  const sample = [];
  for (let d = 0; d < 5; d++) {
    const day = iso(new Date(monday.getFullYear(), monday.getMonth(), monday.getDate() + d));
    people.forEach((person, p) => {
      const first = [3.5, 4, 2.5, 3, 2][(d + 2 * p) % 5];
      sample.push([day, person, ...items[(d + p) % 3], first]);
      sample.push([day, person, ...items[(d + p + 1) % 3], 6.5 - first]);
      if (d === 0) sample.push([day, person, 'OPS-9', 'Weekly client call', 1]);
    });
  }
  base(worklogs, 1000, 5);
  worklogs.getRange(1, 1, 1, 5).setValues([['Date', 'Person', 'Key', 'Summary', 'Hours']]);
  worklogs.getRange(2, 1, sample.length, 5).setValues(sample);
  header(worklogs.getRange('A1:E1'));
  worklogs.getRange('A2:A').setNumberFormat('d mmm yyyy').setHorizontalAlignment('left');
  worklogs.getRange('E2:E').setNumberFormat('0.00');
  worklogs.getRange('E1').setHorizontalAlignment('right');
  worklogs.setColumnWidth(1, 110).setColumnWidth(2, 180).setColumnWidth(3, 90).setColumnWidth(4, 340).setColumnWidth(5, 80);
  worklogs.setFrozenRows(1);
  worklogs.setConditionalFormatRules([band(worklogs, 'A2:E', 2)]);

  // ---- Rates: an hourly rate per person, for the amounts on By person. ----
  const rates = book.insertSheet('Rates');
  base(rates, 200, 2);
  rates.getRange('A1:B4').setValues([['Person', 'Rate per hour'], [people[0], 95], [people[1], 85], [people[2], 110]]);
  header(rates.getRange('A1:B1'));
  rates.getRange('A1').setNote('Names exactly as Jira shows them.');
  rates.getRange('B1').setNote('Per hour, in your invoice currency.').setHorizontalAlignment('right');
  rates.getRange('B2:B').setNumberFormat('#,##0.00');
  rates.setColumnWidth(1, 200).setColumnWidth(2, 120);
  rates.setFrozenRows(1);

  // ---- Timesheet: hours per person per day for the 7 days from the date in B2. ----
  const week = book.insertSheet('Timesheet', 1);
  base(week, 65, 9);
  week.setHiddenGridlines(true);
  title(week.getRange('A1').setValue('Timesheet'), 16);
  week.setRowHeight(1, 40);
  soft(week.getRange('A2').setValue('Week starting'));
  input(week.getRange('B2').setValue(iso(monday))).setNumberFormat('ddd d mmm yyyy').setDataValidation(dateRule);
  week.getRange('C2').setValue('Type any date to see the 7 days from it.');
  soft(week.getRange('C2:I2').merge());
  week.setRowHeight(2, 28);
  week.setRowHeight(3, 12);
  week.getRange('A4').setValue('Person');
  week.getRange('B4:H4').setFormulasR1C1([['=R2C2', '=R4C[-1]+1', '=R4C[-1]+1', '=R4C[-1]+1', '=R4C[-1]+1', '=R4C[-1]+1', '=R4C[-1]+1']]);
  week.getRange('B4:H4').setNumberFormat('ddd d mmm');
  week.getRange('I4').setValue('Total');
  header(week.getRange('A4:I4'));
  week.getRange('A5').setValue('All people');
  week.getRange('B5:I5').setFormulaR1C1('=SUM(R6C:R65C)');
  week.getRange('A5:I5').setFontWeight('bold').setBorder(null, null, true, null, null, null, COLOR.line, solid);
  week.getRange('I5').setFontColor(COLOR.brick);
  week.getRange('A6').setFormula('=IFERROR(SORT(UNIQUE(FILTER(Worklogs!B2:B, Worklogs!B2:B<>"", Worklogs!A2:A>=$B$2, Worklogs!A2:A<$B$2+7))), "")');
  week.getRange('B6:H65').setFormulaR1C1('=IF(RC1="", "", SUMIFS(Worklogs!C5, Worklogs!C2, RC1, Worklogs!C1, R4C))');
  week.getRange('I6:I65').setFormulaR1C1('=IF(RC1="", "", SUM(RC2:RC8))').setFontWeight('bold');
  week.getRange('B5:I65').setNumberFormat('0.00;-0.00;;@');
  week.getRange('B4:I65').setHorizontalAlignment('right');
  week.setColumnWidth(1, 200);
  week.setColumnWidths(2, 7, 84);
  week.setColumnWidth(9, 90);
  week.setFrozenRows(5);
  week.setFrozenColumns(1);
  week.setConditionalFormatRules([
    SpreadsheetApp.newConditionalFormatRule().whenFormulaSatisfied('=WEEKDAY(B$4, 2)>5').setBackground(COLOR.fill).setRanges([week.getRange('B5:H65')]).build(),
    band(week, 'A6:I65', 6),
  ]);

  // ---- By person: hours and amounts per person between the dates in step 1. ----
  const totals = book.insertSheet('By person', 2);
  base(totals, 105, 4);
  totals.setHiddenGridlines(true);
  title(totals.getRange('A1').setValue('By person'), 16);
  totals.setRowHeight(1, 40);
  totals.getRange('A2').setFormula('="From " & TEXT(FromDate, "d mmm yyyy") & " to " & TEXT(ToDate, "d mmm yyyy") & ". Change the dates on Start here."');
  soft(totals.getRange('A2:D2').merge());
  totals.setRowHeight(3, 12);
  totals.getRange('A4:D5').setValues([['Person', 'Hours', 'Rate', 'Amount'], ['All people', '', '', '']]);
  header(totals.getRange('A4:D4'));
  totals.getRange('B5').setFormulaR1C1('=SUM(R6C:R105C)');
  totals.getRange('D5').setFormulaR1C1('=SUM(R6C:R105C)').setFontColor(COLOR.brick);
  totals.getRange('A5:D5').setFontWeight('bold').setBorder(null, null, true, null, null, null, COLOR.line, solid);
  totals.getRange('A6').setFormula('=IFERROR(SORT(UNIQUE(FILTER(Worklogs!B2:B, Worklogs!B2:B<>"", Worklogs!A2:A>=FromDate, Worklogs!A2:A<=ToDate))), "")');
  totals.getRange('B6:B105').setFormulaR1C1('=IF(RC1="", "", SUMIFS(Worklogs!C5, Worklogs!C2, RC1, Worklogs!C1, ">="&FromDate, Worklogs!C1, "<="&ToDate))');
  totals.getRange('C6:C105').setFormulaR1C1('=IF(RC1="", "", IFERROR(VLOOKUP(RC1, Rates!C1:C2, 2, FALSE), ""))');
  totals.getRange('D6:D105').setFormulaR1C1('=IF(OR(RC1="", RC3=""), "", ROUND(RC2*RC3, 2))');
  totals.getRange('B5:B105').setNumberFormat('0.00');
  totals.getRange('C5:D105').setNumberFormat('#,##0.00');
  totals.getRange('B4:D105').setHorizontalAlignment('right');
  totals.setColumnWidth(1, 200).setColumnWidth(2, 90).setColumnWidth(3, 90).setColumnWidth(4, 110);
  totals.setFrozenRows(5);
  totals.setConditionalFormatRules([
    // A person with hours but no rate on Rates.
    SpreadsheetApp.newConditionalFormatRule().whenFormulaSatisfied('=AND($A6<>"", $C6="")').setBackground(COLOR.amber).setRanges([totals.getRange('C6:C105')]).build(),
    band(totals, 'A6:D105', 6),
  ]);

  // Start here's list of tabs, now that each tab has its id.
  [
    [week, 'Hours per person per day, for any week you pick.'],
    [totals, 'Hours and amounts per person, for the dates in step 1.'],
    [worklogs, 'Every worklog, one row each. Get worklogs fills it.'],
    [rates, 'An hourly rate per person, typed by you.'],
  ].forEach(([sheet, text], i) => {
    link(start.getRange(22 + i, 3), '#gid=' + sheet.getSheetId(), sheet.getName() + '  →');
    start.getRange(22 + i, 4).setValue(text);
  });

  book.setActiveSheet(start);
}