You can use
SUMPRODUCT to do conditional counts. While the formula is a little harder to understand than a
COUNTIFS, it allows you way more flexibility in setting conditions. Here is a sample formula where the table is in A1:D100.
Breaking it down:
SUMPRODUCT will sum an array of values. The array can be defined in the function and does not require special array entry.
Each factor in the expression represents a condition. If a condition is met, the value of the factor is 1. If it is not met, the factor is equal to 0. As a result, each product in the array will be equal to either 1 or 0. Those that are equal to 1 correspond to rows where all the conditions are met.
(A1:A100="textA") This is true (1) if the value of the cell in column A is the text "textA".
(B1:B100="textB") This is true (1) if the value of the cell in column B is the text "textB".
(C1:C100*D1:D100=0) This uses an arithmetic trick to do your OR comparison. The product of C and D will be 0 only if one of the two (or both) is equal to 0.
The sum of all these products is equal to your conditional count.