How can I use COUNTIF with the OR function in Excel? 2

How can I use COUNTIF with the OR function in Excel?

COUNTIF is a useful function in Microsoft Excel that allows users to count the number of cells in a range that meet a specific criteria. This function becomes even more powerful when combined with the OR function. By using the OR function within the COUNTIF formula, users can specify multiple criteria and count the cells that meet any of those criteria. This enables users to efficiently analyze data and obtain accurate counts without having to manually sort through the data. With the combination of COUNTIF and OR, Excel users can easily and effectively perform complex calculations and get precise results.

Use COUNTIF with OR in Excel


Often you may want to count the number of cells in a range in Excel that meet one of several criteria.

You can use the following basic syntax to do so:

=SUM(COUNTIF(A:A,{"Value1","Value2", "Value3"})) 

This particular formula counts the number of cells in column A that are equal to “Value1”, “Value2”, or “Value3.”

The following example shows how to use this syntax in practice.

Example: Use COUNTIF with OR in Excel

Suppose we have the following dataset in Excel that shows information about various basketball teams:

We can use the following formula to count the number of cells in column A that have a value of “East” or “South”:

=SUM(COUNTIF(A:A,{"East","South"}))

The following screenshot shows how to use this formula in practice:

COUNTIF with OR in Excel

We can see that a total of 5 cells have a value of “East” or “South” in column A.

Note that we can also use similar syntax to count the number of cells that have specific numeric values.

For example, we can use the following formula to count the number of cells in column C that have a value of 95, 99, or 103:

=SUM(COUNTIF(C:C,{95, 99, 103}))

The following screenshot shows how to use this formula in practice:

We can see that a total of 6 cells have a value of 95, 99, or 103 in column C.

We could also use similar syntax to count the number of cells that have values greater than or less than certain numbers.

For example, we can use the following formula to count the number of cells in column C that have a value greater than 100 or less than 90:

=SUM(COUNTIF(C:C,{">100", "<90"}))

The following screenshot shows how to use this formula in practice:

We can see that a total of 7 cells have a value greater than 100 or less than 90 in column C.

Additional Resources

The following tutorials explain how to perform other common COUNTIF() operations in Excel:

Cite this article

stats writer (2024). How can I use COUNTIF with the OR function in Excel?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-use-countif-with-the-or-function-in-excel/

stats writer. "How can I use COUNTIF with the OR function in Excel?." PSYCHOLOGICAL SCALES, 1 Jul. 2024, https://scales.arabpsychology.com/stats/how-can-i-use-countif-with-the-or-function-in-excel/.

stats writer. "How can I use COUNTIF with the OR function in Excel?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-use-countif-with-the-or-function-in-excel/.

stats writer (2024) 'How can I use COUNTIF with the OR function in Excel?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-use-countif-with-the-or-function-in-excel/.

[1] stats writer, "How can I use COUNTIF with the OR function in Excel?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, July, 2024.

stats writer. How can I use COUNTIF with the OR function in Excel?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.

Download Post (.PDF)
Slide Up
x
PDF
Scroll to Top