Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

COUNTIF not working with string "True" or "False"

I have this very simple columns of either string True or False.

I am trying to use this formula = COUNTIF(F2:F, "True") to get the number of True in the column. But its not working. It works with other strings such as apples, but never with True or False.

enter image description here

How do you compare that?

like image 266
theblindprophet Avatar asked Nov 15 '25 20:11

theblindprophet


2 Answers

Adding a wildcard at the end of the string seems to work well for both true and false text strings.

=COUNTIF(F2:F13,"Tru*")

However it runs the risk of matching unwanted strings, for example the text string TrueThat would be matched by "Tru*"

like image 139
Jeff Avatar answered Nov 17 '25 10:11

Jeff


Please try:

=countif(F2:F,"'"&"True")

(Or better still, avoid True and False as Text.)

like image 29
pnuts Avatar answered Nov 17 '25 11:11

pnuts