Count Cells Containing TRUE or FALSE in Excel

Add to Favorites
Author:

Count the number of cells that contain TRUE, FALSE, or one of the two. This lets you count the logical values in a range in Excel.

Sections:

Count Cells that Contain TRUE

Count Cells that Contain FALSE

Count Cells that Contain TRUE or FALSE

Notes

Count Cells that Contain TRUE

=COUNTIF(A1:A5,TRUE)

A1:A5 is the range in which to count; change it to fit your data.

TRUE is the value that we want to count. Note that this does not require quotation marks around it; TRUE and FALSE are special elements in Excel.

a3ce3e1ddc264d03141c10158e61ee4a.png

Result:

c01d0884776f6ad2cc309211a2b82837.png

Count Cells that Contain FALSE

=COUNTIF(A1:A5,FALSE)

A1:A5 is the range in which to count; change it to fit your data.

FALSE is the value that we want to count. Note that this does not require quotation marks around it; TRUE and FALSE are special elements in Excel.

bb9bc8294b9e3575720074ccb1cb9109.png

Result:

c2ee13c58f8a3533d17c463e4c3fc789.png

Count Cells that Contain TRUE or FALSE

Essentially, we now combine the last two examples into one formula.

=COUNTIF(A1:A5,TRUE)+COUNTIF(A1:A5,FALSE)

d390469c176b548c4cbc5c05936ce602.png

Result:

286d309c95ffcd970fda86ab6e528994.png

Notes

This is pretty basic COUNTIF stuff combined with the logical values of TRUE and FALSE and, as you can see, it's not complex. The one thing to remember is that you do not put quotation marks around TRUE and FALSE; now, you can get away with doing that, but it's not necessary.

Download the sample file for this tutorial to work with these examples in Excel.


Excel Function: COUNTIF()
Downloadable Files: Excel File

Question? Ask it in our Excel Forum


Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons 50+ Hours of Instruction 200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Similar Content on TeachExcel
Determine if Cells Contain a Specific Value in Excel
Tutorial: Find if a cell or range of cells contains a specific value in Excel. This method can be us...
Multiply by True and False in Excel
Tutorial: You can multiply numbers by TRUE and FALSE in Excel. This effectively allows you to elimi...
Convert Numbers into True and False in Excel
Tutorial: How to convert numbers into the TRUE and FALSE Boolean values in Excel. This is very impor...
NOT Function - Change False to True and True to False in Excel
Tutorial: Change True to False and False to True with this simple function in Excel. To do this, we...
Check if Cell is Empty or Not in Excel
Tutorial: How to check if a cell is empty or is not empty in Excel; this tutorial shows you a couple...
Sum Values from Every X Number of Rows in Excel
Tutorial: Add values from every x number of rows in Excel. For instance, add together every other va...
Tutorial Details
Excel Function: COUNTIF()
Downloadable Files: Excel File
Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course