You can use the custom formula function in Google Sheets to change the color of a cell when a checkbox is checked.
The following example shows how to use the custom formula function in practice.
Example: Conditional Formatting Based on Checkbox
Suppose we have the following dataset in Google Sheets that contains the names of a list of students and whether or not they passed the final exam in a certain class:
Suppose we would like to highlight the name of the student in green if the checkbox in the corresponding column is checked.
To do so, we can click the Format tab, then click Conditional Formatting:
In the Conditional format rules panel that appears on the right side of the screen, type A2:A11 in the box called Apply to range.
Then choose Custom formula is from the dropdown menu under Format cells if… then type the following formula into the box:
Once you click Done, each cell in column A that has a checkbox checked in column B will automatically be highlighted in green:
If you then check a new checkbox, such as the one next to student J, the student name will automatically become highlighted in green:
Note #1: In Google Sheets, if a checkbox is checked then that cell has an underlying value of TRUE, which is why we use the formula =$B2=TRUE() to determine if a checkbox is checked.
Note #2: In this example we chose to use a light green fill for the conditional formatting of the cells but you can choose any fill color you’d like by clicking the paint can icon under the Formatting style box.
The following tutorials explain how to perform other common tasks in Google Sheets: