Google-sheets – How to use Google Sheets checkboxes with logic

google sheets

As of April 2018, checkboxes have been added to Google Sheets. They are utilized by going to Insert->Checkbox, which converts the cell(s) to checkbox form. When unchecked, by default the value becomes FALSE and when checked, TRUE.

The criteria for checked/unchecked can be changed via Data Validation.

As far as I can tell, the only way to retain the checkbox form is by manually entering the data precisely or checking/unchecking it. If the data isn't exactly TRUE or FALSE, then the checkbox goes away and instead the values are shown.

There is no information found in Google's Documentation, that I can tell.


As an example of the problem, the data validation rules and checkbox formatting go away if you use "=TRUE" in the formula bar instead of just "TRUE".

How can I set the cell's contents using a formula while still being able to use the new checkbox feature?

Best Answer

Short answer

Instead of using the Insert > Checkbox use the Unicode characters ballot box / checked ballot box:

or another similar character / emoji

Example

=IF(ISTEXT(A1),"☑","☐")

Explanation

At this time there isn't an operand, function or format for an Insert > Checkbox the same as there isn't any of this for an Insert > Chart, Insert > Image, Insert > Note, Insert > Comment

NOTES:

  • SPARKLINE function works completely different than an Insert > Chart
  • IMAGE function works completely different than an Insert > Image

The exception could be:

  • HYPERLINK function similar to an Insert > Link