Only Count Certain Values With CountIf()

 

The "CountIf()" function counts the number of values that satisfy the condition. You should also use the "Distinct()" function if multiple occurrences of values are only to be counted once.

The first parameter specifies the expression for the compare. The (optional) second parameter specifies whether the values used for the calculation are to be deleted after outputting (default: True).

 

Examples:

CountIf (Customers.Region="US")

CountIf (Distinct(Customers.Region="US"))     multiple occurrences of values are only counted once

CountIf (IsNull (Orders.OrderDate)) counts all values whose content is empty