Forum Discussion
Checkboxes not automatically updating using COUNTIF
I assume the formula you meant to use is:
=IF(COUNTIF(B2:B3,TRUE)=2,TRUE,FALSE)and there does seem to be something buggy in the online version. It works fine in the desktop version but online I can literally see it toggle and then revert back to the incorrect answer.
Although not great, by adding OFFSET() (which is a 'volatile function') it does seem to "fix" the problem:
=IF(COUNTIF(OFFSET(B2:B3,0,0),TRUE)=2,TRUE,FALSE)You should also report the bug to MS and hopefully they can figure it out and fix it.
Intersestingly enough this gives me an opportunity to investigate Volatile functions. For example any of the following also work (i.e. are volatile) as expected:
=IF(AND(B2,B3)+0*RAND(),TRUE,FALSE)
=IF(AND(B2,B3)+0*NOW(),TRUE,FALSE)
=IF(AND(B2,B3)+0*TODAY(),TRUE,FALSE)
=IF(AND(B2,B3)+0*RAND(),TRUE,FALSE)
and using INDEX() in the following case does not act as volatile:
=IF(AND(INDEX(B2:B3,0)),TRUE,FALSE)
but using INDEX() to help define a range in the following DOES act volatile:
=IF(AND(B2:INDEX(B3,1))+0,TRUE,FALSE)
Similar is true for TAKE()
=IF(AND(TAKE(B2:B6,2)),TRUE,FALSE) <= not volatile
=IF(AND(B2:TAKE(B3,1)),TRUE,FALSE) <= volatile