How to use a checkbox in an IF formula in Excel
Formula (Excel and Google Sheets)
=IF(C2,"Done","Open")A checkbox holds TRUE or FALSE, so use the cell itself as the test: =IF(C2,"Done","Open").
- Result on the example
- one result per row in
D2, filled down toD7 - Works in
- Every current version
- Google Sheets
- Same formula
See it work
The formula is already in D2, filled down to D7. Change any input and the result updates, or edit the formula to experiment.
How it works
A ticked checkbox stores TRUE and an unticked one FALSE. IF's first argument is already a TRUE/FALSE test, so the cell can be the whole test. The same works for any cell holding TRUE or FALSE, such as the result of a comparison.
=IF(C2,"Done","Open")Result"Done"
C2TRUEThe value in C2.
IF(C2,"Done","Open")"Done"IF: Returns one value if a test is true, another if false.- logical_test
C2TRUE - value_if_true
"Done" - value_if_false
"Open"not used
- logical_test
In Google Sheets
The same formula works in Google Sheets: =IF(C2,"Done","Open"). We ran it in Google Sheets mode on the same data and it returns the same results.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =IF(C2=TRUE,"Done","Open") | Done, Open, Done… | Spelling out =TRUE does the same and can read more clearly. |
| =IF(C2,0,B2) | 0, 1.5, 0…Different result | Returns the hours still to do: 0 for finished tasks, the task's hours for open ones. Shows remaining hours instead of a label. |
Common mistakes
C2="TRUE"compares with the text "TRUE", which never equals the value TRUE. Leave out the quotes.- In Google Sheets a checkbox can use custom values such as "Yes" and "No". Then test
C2="Yes". - An empty cell counts as FALSE, so a row with no checkbox shows "Open".
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Use a checkbox in an IF formula
D2, show "Done" when the checkbox value in C2 is TRUE and "Open" when it is FALSE. Fill down to D7.Questions
How do I count checked boxes?
=COUNTIF(C2:C7,TRUE).
How do I total the hours of finished tasks?
=SUMIF(C2:C7,TRUE,B2:B7).
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.