Google Sheets Checkbox Strikethrough: Setup Guide

How-to basics · Updated November 3, 2026

Google Sheets Checkbox Strikethrough: Setup Guide

Google Sheets checkboxes cannot apply strikethrough through the built-in conditional-formatting controls. To strike through a row when its checkbox is checked—and remove the line when it is unchecked—use a short Apps Script; for a no-code option, use conditional formatting to change the row’s color instead.

Why Checkbox Strikethrough Needs a Workaround

A standard Google Sheets checkbox stores a value: a checked box is usually TRUE, and an unchecked box is FALSE. Conditional formatting can use that value to change the appearance of related cells. However, its formatting choices do not include strikethrough. The rule can change text color, fill color, bold, italic, or underline, but it cannot draw a line through the row’s text.

That distinction matters because a conditional-formatting rule is often the first solution people try. The condition itself works; the missing piece is the strikethrough style. Apps Script can directly set a cell’s font line to strikethrough when the checkbox changes, so it is the practical option when crossing out text is essential.

The instructions below assume a task sheet with checkboxes in column A, task details in columns A through H, and data beginning on row 2. You can change those references to match your own layout.

Use Conditional Formatting for a No-Code Visual Cue

If a gray or muted completed row is acceptable, conditional formatting is simpler and does not require a script. For example, to shade completed tasks in A2:H100 based on the checkbox in column A:

  1. Select the range A2:H100, or the equivalent range in your sheet.
  2. Choose Format > Conditional formatting.
  3. In the conditional-formatting panel, choose Custom formula is as the rule type.
  4. Enter =$A2=TRUE.
  5. Choose a fill or text color that makes completed rows look subdued, then select Done.

The dollar sign locks the checkbox column as the rule is applied across the row, while the row number remains relative. As a result, row 2 checks A2, row 3 checks A3, and so on. If your checkbox is in column D, use =$D2=TRUE instead. Make sure the row number in the formula matches the first row of the selected range.

Google Sheets’ conditional-formatting interface is different from Excel’s, and the available styles are not identical. In particular, this rule can provide a useful completed-task cue, but it will not strike through text. For an actual line through the row’s text, continue with Apps Script.

Set Up a Script to Strike Through Checked Rows

This script responds when someone edits the checkbox column. It reads the checkbox values in the edited rows and applies strikethrough to columns A through H for checked tasks. Unchecking a box removes the line. Change the sheet name and column limits in the code if your layout differs.

  1. In the spreadsheet, select Extensions > Apps Script.
  2. In the script editor, replace the sample contents with the code below.
  3. Change Tasks to the exact name of your sheet tab. Adjust lastColumn if your task rows extend beyond column H.
  4. Save the project, return to the sheet, and check a box in column A on a data row.
function onEdit(e) {
  const sheet = e.range.getSheet();
  if (sheet.getName() !== 'Tasks') return;

  const checkboxColumn = 1; // Column A
  const firstDataRow = 2;
  const firstColumn = 1; // Start formatting at column A
  const lastColumn = 8;  // End formatting at column H
  const editedRange = e.range;

  // Continue only if the edit includes the checkbox column.
  if (editedRange.getLastColumn() < checkboxColumn ||
      editedRange.getColumn() > checkboxColumn) return;

  const startRow = Math.max(editedRange.getRow(), firstDataRow);
  const endRow = editedRange.getLastRow();
  if (endRow < startRow) return;

  const checkboxValues = sheet
    .getRange(startRow, checkboxColumn, endRow - startRow + 1, 1)
    .getValues();

  checkboxValues.forEach((row, index) => {
    const fontLine = row[0] === true ? 'line-through' : 'none';
    sheet
      .getRange(startRow + index, firstColumn, 1, lastColumn - firstColumn + 1)
      .setFontLine(fontLine);
  });
}

The function is named onEdit, so Google Sheets runs it automatically when a user edits the spreadsheet; you do not need to deploy it as a web app. Do not click Run in the script editor to test it: an edit-trigger function expects an event object supplied by the spreadsheet. Test by changing a checkbox in the sheet instead.

How the Script Matches Checkboxes to Rows

The script checks whether the edited range overlaps column A, then reads the checkbox values for the affected rows. It applies formatting to each corresponding row, rather than putting the same style on every row in the sheet. The getValues() check expects standard checkboxes, which return the Boolean value TRUE when checked.

In the example, firstDataRow is 2 so the header row is left alone. firstColumn and lastColumn define the area receiving the line. If task names are in B and notes are in C through F, you could set the formatting range to B:F by changing the first and last column numbers to 2 and 6. The checkbox in A would then control the row without having its cell included in the formatting range.

The script also checks rows when a multi-cell edit includes column A, such as pasting several checkbox values at once. A change in another column will not run the formatting logic for that row. If your checkboxes use custom checked and unchecked values rather than the standard Boolean values, change the comparison to match the checked value configured for those checkboxes.

Choose Between Strikethrough, Color, and a Separate Status

The right completion signal depends on how the sheet is used. Strikethrough is familiar in personal to-do lists, but it can reduce readability when descriptions are long or when a completed item still needs to be reviewed. A subdued fill color or text color can be easier to scan, especially in a shared tracker.

  • Use strikethrough when crossing out finished tasks is a meaningful visual convention and you are comfortable using a script.
  • Use conditional formatting when you want a no-code completed-row cue, such as gray text or a light fill.
  • Use a status column when tasks need more than two states, such as Not started, In progress, Blocked, and Done. A checkbox represents only a checked or unchecked state.
  • Keep the checkbox visible when users need to filter or count completion reliably; do not rely on formatting alone to store task status.

Formatting is a visual layer, not a substitute for the checkbox value. A task can be completed even if a user later changes its font or clears its formatting. Keeping status in the checkbox or a dedicated status field makes the information easier to filter, count, and reuse.

Common Problems and Practical Limits

If checking a box does nothing, first confirm that the tab name in the code exactly matches the sheet tab, including spaces and capitalization. Then confirm that the checkbox is in the configured column, that the task starts on or below the configured first data row, and that the script’s last column includes the cells you want formatted. The script does not run for edits made on a different tab.

Also check whether the cell is a standard checkbox. A checkbox configured with custom values may return text instead of the Boolean value TRUE, so the comparison in the code must match its checked value. If a checkbox is changed by a formula recalculation rather than by a person editing the sheet, the simple edit trigger does not respond to that recalculation.

When the box is unchecked, the script sets the font line to none. That removes strikethrough, but it can also remove a manually applied underline or other font-line formatting from the affected cells. Keep the task range’s baseline formatting consistent, or adjust the script if you need to preserve special formatting. The script changes formatting, not cell contents, and it does not delete completed tasks.

Google Sheets and Excel are separate programs with different scripting and conditional-formatting tools. These menu directions and the Apps Script example are for Google Sheets in a web browser; an Excel workbook would require a different approach, such as Excel’s own automation features.

Sharing, Permissions, and Maintenance

Because the script is attached to the spreadsheet, people working in that file should understand that checkbox edits can change row formatting. A simple onEdit trigger runs in response to user edits and is suitable for this kind of formatting task. Avoid adding unrelated actions or external services to a simple trigger without checking whether they require additional authorization.

Before relying on the setup in an important tracker, test it on a copy or a few sample rows. Check a box, uncheck it, edit a row outside the checkbox column, and try a multi-row paste if your team uses one. If the sheet is renamed, update the name in the code. If rows are inserted above the data, review the starting-row assumption and the conditional-formatting range as well.

For a sheet that must remain entirely no-code, use the conditional-formatting color cue. For a sheet where true strikethrough is a requirement, keep the script short and make its checkbox column, data start row, and formatting range explicit so future editors can maintain it.

Frequently Asked Questions

Can Google Sheets strikethrough a row automatically when I check a box?
Not with the built-in conditional-formatting styles. Use an Apps Script edit trigger to apply and remove strikethrough, or use conditional formatting for a color-based visual cue.

What formula makes conditional formatting follow a checkbox?
For a range beginning on row 2 with checkboxes in column A, use =$A2=TRUE as the custom formula. Lock the checkbox column with the dollar sign and keep the row reference relative.

Can I strike through only the task name instead of the whole row?
Yes. In the script, change the formatting range to the task-name column only. For example, set firstColumn and lastColumn both to 2 to format column B while the checkbox remains in column A.

Why does unchecking the box remove other font formatting?
The example resets the font-line style to none. If the affected cells had manual underline or other line formatting, that reset can remove it. Use a consistent baseline style or customize the script to preserve your formatting choices.

Will the script work if someone pastes several checkbox values?
The example processes the rows in an edited range that includes the checkbox column and reads each row’s checkbox state. It is designed for standard checkbox values; custom checkbox values need a matching comparison in the code.

Can I do this in Excel the same way?
No. The directions here use Google Sheets and Apps Script. Excel has different conditional-formatting and automation features, so its setup is not the same.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.