How to use COUNTIF with OR

To use COUNTIF with OR in Google Sheets, you need to use multiple COUNTIF functions and add them together. Google Sheets doesn't have a built-in COUNTIF with OR functionality, but by adding multiple COUNTIF functions, you can achieve the desired results.

Here's a step-by-step guide on how to use COUNTIF with OR in Google Sheets:

  1. Open your Google Sheet or create a new one.
  2. Make sure you have your data organized in a way that will work for your COUNTIF functions.
  3. Identify the range you want to apply the COUNTIF function to, and the criteria you want to count.
  4. To create a COUNTIF with OR functionality, use the formula =COUNTIF(range, criterion1) + COUNTIF(range, criterion2) - COUNTIFS(range, criterion1, range, criterion2), replacing range, criterion1, and criterion2 with your specific range and criteria.

Example

Let's say you have a list of fruits in column A and you want to count how many cells contain either "apple" or "orange". Here's how you can use COUNTIF with OR in this case:

  1. Your data is in column A, with the fruits listed in cells A1:A10.
  2. You want to count cells containing "apple" or "orange".
  3. Use the COUNTIF with OR formula in an empty cell: =COUNTIF(A1:A10, "apple") + COUNTIF(A1:A10, "orange") - COUNTIFS(A1:A10, "apple", A1:A10, "orange")

This formula counts the number of cells containing "apple" and the number of cells containing "orange" and subtracts the number of cells containing both "apple" and "orange" (if any). In this case, there shouldn't be any cells containing both "apple" and "orange", so the COUNTIFS part should return 0.

The result will show the total count of cells containing either "apple" or "orange".

Did you find this useful?