How to use the COUNTIF Function in Excel? As a worksheet function, the COUNTIF Function can be entered as part of a formula in a cell of a worksheet. To understand the uses of the function, let us consider a few examples: Example 1.
= (C5:C14, 'red',D5:D14, 'TX' ) // red and TX = (C5:C14, 'red',F5:F14, '20' ) // red and 20 Notes:. Each additional range must have the same number of rows and columns as range1, but ranges do not need to be adjacent. If you supply ranges with a mismatch, you'll get a #VALUE error.
Non-numeric criteria needs to be enclosed in double quotes but numeric criteria does not. For example: 100, '100', '32', 'jim', or A1 (where A1 contains a number).
The wildcard characters? And. can be used in criteria.
A question mark matches any one character and an asterisk matches any sequence of characters. To find a literal question mark or asterisk, use a tilde in front question mark or asterisk (i.e.