Vendor/phpspreadsheet/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical.php
public static function COUNTIF($aArgs, $condition)
    {
        $returnValue = 0;

        $aArgs = Functions::flattenArray($aArgs);
        $condition = Functions::ifCondition($condition);
        // Loop through arguments
        foreach ($aArgs as $arg) {
            if (!is_numeric($arg)) {
                $arg = Calculation::wrapResult(strtoupper($arg));
            }
            $testCondition = '=' . $arg . $condition;
            if (Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
                // Is it a value within our criteria
                ++$returnValue;
            }
        }

        return $returnValue;
    }
public static function COUNTIF($aArgs, $condition)
    {
        $returnValue = 0;

        $aArgs = Functions::flattenArray($aArgs);
        $condition = Functions::ifCondition($condition);
        // Loop through arguments
        foreach ($aArgs as $arg) {
            if (!is_numeric($arg)) {
                $arg = Calculation::wrapResult(strtoupper($arg));
            }
            $testCondition = '=' . $arg . $condition;
            if (Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
                // Is it a value within our criteria
                ++$returnValue;
            }
        }

        return $returnValue;
    }
COUNTIF.

Counts the number of cells that contain numbers within the list of arguments

Excel Function:
COUNTIF(value1[,value2[, ...]],condition)

@category Statistical Functions

@param mixed $aArgs Data values
@param string $condition the criteria that defines which cells will be counted

@return int