# How to use a checkbox in an IF formula in Excel

A checkbox holds TRUE or FALSE, so use the cell itself as the test: =IF(C2,"Done","Open").

**Excel:** `=IF(C2,"Done","Open")` (Every current version)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D |
| --- | --- | --- | --- |
| Task | Hours | Done | Status |
| Draft brief | 3 | true |  |
| Client review | 1.5 | false |  |
| Design mockups | 6 | true |  |
| Build page | 8 | false |  |
| QA pass | 2 | false |  |
| Launch | 1 | true |  |

Formula in D2, filled to D7: `=IF(C2,"Done","Open")`

Result: Done; Open; Done; Open; Open; Done

## 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.

## Other ways

- `=IF(C2=TRUE,"Done","Open")`: Spelling out =TRUE does the same and can read more clearly.
- `=IF(C2,0,B2)`: 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".

## 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)`.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/if-checkbox-is-checked
