COUNTIF = "True" as string, not boolean

STEVEMILLS04

Board Regular
Joined
Oct 8, 2009
Messages
113
I run a report from our HR system that outputs a True/False column as a string (verified using =TYPE() formula). When attempting to do the countif formula below on the column it does not count them:

Code:
=COUNTIF(TermList[Is Voluntary?],"False")

It works when I change the column to a Boolean and change the formula to FALSE rather than "False" but this would not be my preferred method because I don't want to have to edit the column every time I run the report.

Any tips?
 
Last edited:

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Try:
Code:
=SUMPRODUCT(--(LEN(termLists[Is Voluntary?])=5))
This will fail if other string values exist that are not "False" but are (also) 5 characters in length
 
Upvote 0
I don't think there's any way around that with countif (or sumif/averageif).
When it see's "False" as your criteria argument, it converts it to the Boolean False
And there are no Boolean False's in the range, so it won't count.

Try
=SUMPRODUCT(--(TermList[Is Voluntary?]="False"))
 
Upvote 0
Thanks Jack, I should have mentioned that my formula is actually a much longer IF/COUNTIFS formula:

Code:
=IF(Month>=C2,COUNTIFS(TermList[Location ID],$A2,TermList[Job Title],$D2,TermList[Term Month],MONTH($C2),TermList[Term Year],YEAR($C2),TermList[Is Voluntary?],"False"),0)
 
Upvote 0
I might suggest converting that column of Textual True/False values to actual Booleans...

Highlight the column, go to Data - Text To Columns
Select Deliminated - Next
UNcheck all options
Finish.
 
Upvote 0
@Jonmo1's suggestion will account for value of "False" only, can you adapt their suggestion into your longer formula?

Jonmo1 re data conversion:
but this would not be my preferred method because I don't want to have to edit the column every time I run the report.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top