WorksheetFunction.CountIf(Range, Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Counts the number of cells within a range that meet the given criteria.
public:
double CountIf(Microsoft::Office::Interop::Excel::Range ^ Arg1, System::Object ^ Arg2);
public double CountIf (Microsoft.Office.Interop.Excel.Range Arg1, object Arg2);
Public Function CountIf (Arg1 As Range, Arg2 As Object) As Double
Parameters
- Arg1
- Range
The range of cells from which you want to count cells.
- Arg2
- Object
The criteria in the form of a number, expression, cell reference, or text that defines which cells will be counted. For example, criteria can be expressed as 32, "32", ">32", "apples", or B4.
Returns
Returns Double.
Remarks
You can use the wildcard characters, question mark (?) and asterisk (*), for the criteria. A question mark matches any single character; an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) before the character.