How to Format a Whole Row When a Checkbox Is Checked in Excel

Checkboxes in Microsoft Excel are a great tool for tracking progress, improving data organization, and adding an extra layer of automation to your spreadsheet. What’s more, you can format a whole row in your worksheet when a corresponding checkbox is checked.

This article refers to in-cell checkboxes added via the Insert tab on the ribbon, not floating ones added through the Developer tab. In-cell checkboxes are available to those using Excel for Microsoft 365, Excel for the web, and the Excel mobile and tablet apps.

OS

Windows, macOS, iPhone, iPad, Android

Free trial

1 month

Microsoft 365 includes access to Office apps like Word, Excel, and PowerPoint on up to five devices, 1 TB of OneDrive storage, and more.


How Checkboxes Work in Excel

Before I show you how to format a whole Excel row when a checkbox in that row is checked, let’s take a moment to understand how checkboxes work.

To add checkboxes to selected cells, click “Checkbox” in the Insert tab on the ribbon.

Checkboxes are inserted in a column named 'Completed' in a regular Excel range.

You can manually check and uncheck a checkbox by clicking it or selecting the cell and pressing Space.

A checkbox in Excel is checked manually via a mouse click.

All checkboxes have underlying Boolean values: a checked checkbox represents a value of TRUE, while an unchecked checkbox represents a value of FALSE. You can see this by selecting a cell containing a checkbox and looking in the formula bar. Knowing these underlying values will help you immensely when you go to use checkboxes to format whole rows in Excel.

The formula bar in Excel reads 'TRUE' because the selected cell contains a checked checkbox.

Because checkboxes represent TRUE or FALSE, you can use formulas to check and uncheck them. In this example, the checkbox in cell C3 is checked because the value in cell B3 is greater than or equal to 80.

A checkbox in Excel is checked because the underlying formula returns TRUE.

Formatting Whole Rows in Regular Ranges When a Checkbox Is Checked

Now that you know how checkboxes work, you’re ready to use them alongside conditional formatting to format a whole row.

Suppose you’ve created this spreadsheet, which contains task numbers in column A, assignees in column B, and checkboxes in column C, all in a regular Excel range (in other words, not formatted as an Excel table).

An Excel spreadsheet, with tasks in column A, assignees in column B, and checkboxes in column C.

To follow along as you read this guide, download a free copy of the Excel workbook used in the examples. After you click the link, you’ll find the download button in the top-right corner of your screen.

Your aim is to format a whole row when a task is completed. That is to say, when you check a checkbox in column C, you want the whole row that the checkbox is on to adopt certain formatting.

To do this, first, select rows 2 to 11 by clicking and dragging the cursor from the row heading of row 2 to the row heading of row 11.

Rows 2 to 11 in an Excel worksheet are selected.

Next, in the Home tab on the ribbon, click Conditional Formatting > New Rule.

New Rule is selected in Excel's Conditional Formatting dropdown menu.

Then, in the New Formatting Rule dialog box, click “Use A Formula To Determine Which Cells To Format.”

Use A Formula To Determine Which Cells To Format is selected in the New Formatting Rule in Excel.

The reason you need to use a formula is that the formatting of the selected rows is dependent on the value of another cell. In this case, you want the row to be formatted when the corresponding checkbox in column C is checked (thus representing the Boolean value TRUE). On the other hand, if the checkbox is unchecked (thus representing the Boolean value FALSE), the formatting of the respective row will remain as is.

So, in the formula field, start by typing an equal (=) sign.

An equal sign is typed into the formula field in Excel's New Formatting Rule dialog box.

When applying conditional formatting rules to a range of cells in Excel, the formula you type must correspond to the first cell you selected. You can tell which cell was the first one you selected by seeing which one in the selection is white. In this case, because the first row you selected was row 2, you need to focus on creating a rule that applies to this row.

The first cell in a selected range in Excel is white, indicating that a conditional formatting rule that uses a formula will apply to this cell.

As a result, since you want to check whether the checkbox cell C2 is checked, select this cell to add a reference to the formula.

A cell is selected in Excel to add a reference to a conditional formatting formula.

Notice how, at the moment, the cell reference contains a dollar sign before both the column and row, also known as an absolute reference. This means that all the rows you selected will be formatted when the checkbox in cell C2 is checked. However, this isn’t what you want—you only want row 2 to adopt the formatting. So, with your cursor placed directly after the $C$2 cell reference in the formula, press F4 twice, so that only the column reference is preceded by a dollar sign.

A mixed reference is typed in the formula field in Excel's New Formatting Rule dialog box.

Now, the column reference is absolute, but the row reference is relative, meaning that the rule will adapt to each row. In other words, the reference for row 3 will be $C3, the reference for row 4 will be $C4, and so on.

Next, you want to complete the formula by evaluating whether the checkbox is checked. To do this, type another equal sign, followed by TRUE:

=$C2=TRUE
A logical formula is typed into the formula field of Excel's New Formatting Rule dialog box.

Then, click “Format,” and choose the formatting you want to apply when the rule is fulfilled. In my case, I want the whole row to turn green, but you can also apply other formatting via the Font tab, like turning the font red or using a strikethrough effect.

Green fill is selected for a conditional formatting rule in Excel.

Finally, click “OK” twice to close the two dialog boxes, and check one of the checkboxes to see your new rule in action.

Three rows in an Excel spreadsheet are filled green, thanks to a conditional formatting rule that evaluates whether checkboxes are checked.

Pros and Cons of Using Conditional Formatting to Format Whole Rows in Regular Ranges

One of the benefits of formatting a whole row is that if you add more data to the right, the rules you set up already apply to these additional columns, so there’s no extra work for you to do.

A column headed 'Return' is added to existing data in Excel, and conditional formatting is used to color the whole row where a checkbox is checked.

However, this approach also comes with two significant drawbacks. First, formatting whole rows can significantly hamper Excel’s performance. This is especially true when you apply formatting through conditional formatting because it constantly re-evaluates whenever the data is changed. To overcome this, rather than selecting whole rows, apply the conditional formatting rule to the range width only.

The second drawback becomes evident when you populate rows directly beneath the range. When you do this, Excel generates inaccurate conditional formatting rules as it struggles to account for the changes in the size of your data.

An Excel worksheet containing inconsistent conditional formatting rules because an extra row was added to a regular range.

To fix this, select any cell containing the correct rule you set up earlier, click Conditional Formatting > Manage Rules in the Home tab, and expand the cell reference in the Applies To field by one row. For example, if the rule currently applies to rows 2 to 11, change “11” to 12, and click “OK.”

The Applies To field in Excel's Conditional Formatting Rules Manager is adjusted to account for an extra row added to the data.

This tweak to the rule now picks up the extra row of data and formats it accordingly.

A conditional formatting rule that colors a whole row when a checkbox is checked is applied to a new row of data in a regular range.

Formatting Whole Rows in Excel Tables When a Checkbox Is Checked

If, like me, you prefer presenting your data in Excel tables rather than using unformatted ranges, you can format a whole table row when a checkbox is checked.

If you’re following along in the sample file, head to the tab named “Formatted Tables” for this second exercise.

After adding the checkboxes via the Insert tab on the ribbon, select the whole table—starting in cell A2 and finishing in cell C11—and in the Home tab on the ribbon, click Conditional Formatting > New Rule.

A table in Excel is selected, and New Rule in the Conditional Formatting dropdown menu is highlighted.

To format a range as a table, select the relevant cells, press Ctrl+T, check “My Table Has Headers,” and click “OK.”

Now, click “Use A Formula To Determine Which Cells to Format,” and begin the formula in the text field with an equal sign.

An equal sign is typed into the formula field in Microsoft Excel's New Formatting Rule dialog box.

Since cell A2 is the active cell in the selection, you need to generate a formula that applies to row 2. So, select the cell on row 2 that contains the checkbox (in this case, cell C2) to add a reference to the formula.

A cell is selected in Microsoft Excel to add a reference to a conditional formatting formula.

The cell reference is currently absolute, meaning all the cells in the table will be formatted when the checkbox in cell C2 is checked. To fix this, press F4 twice, turning it into a mixed reference where the column is fixed and the row is relative.

A mixed reference is typed in the formula field in Microsoft Excel's New Formatting Rule dialog box.

Now, complete the formula by typing another equal sign, followed by TRUE, to tell Excel that you only want to format the rows where the corresponding cell in column C contains TRUE (a checked checkbox).

A logical formula is typed into the formula field of Microsoft Excel's New Formatting Rule dialog box.

Finally, click “Format” to apply the relevant formatting, and then click “OK” twice to close the dialog boxes and see the rule working in your dataset.

Three rows in an Excel table are filled green, thanks to a conditional formatting rule that evaluates whether checkboxes are checked.

Pros and Cons of Using Conditional Formatting to Format Table Rows

One of the biggest benefits of using Excel tables is that new rows added to the bottom of the existing dataset adopt the rules and formulas applied to the rows above. As a result, you can easily expand your data downward without worrying about tweaking the conditional formatting rule you just created.

A new row of data is added to an Excel table, and a conditional formatting rule that colors a row when a checkbox is checked is applied automatically.

Another benefit of formatting a table row rather than the whole row in the spreadsheet is that you’re not asking Excel to work as hard. In the example above, checking a checkbox only applies formatting to three cells, rather than the 16,000-plus cells that make up the width of an Excel spreadsheet.

That said, a drawback of using conditional formatting to format table rows is that the rule doesn’t apply to new columns added to the right.

Whole-row conditional formatting rules are not applied to a new column added to the right in an Excel table.

To fix this, select any cell containing the rule you set up earlier, click Conditional Formatting > Manage Rules in the Home tab, and expand the cell reference in the Applies To field by one column. For example, if the rule currently applies to columns A to C, change “C” to D, and click “OK.”

The Applies To field in Excel's Conditional Formatting Rules Manager is adjusted to account for an extra column added to the data.

Now, the new column adopts the whole-row conditional formatting.

A new column of data in an Excel table that has adopted whole-row conditional formatting rules.


Checkboxes in Excel are like gold dust if you’re a project manager working in Excel, as they’re a versatile tool that you can use to track task progress. For example, you can use the IF function to generate a text value according to a checkbox’s status, or the COUNTIF function to calculate the percentage of checkboxes that are checked.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top