You are here

public static function PHPExcel_Calculation_Statistical::COUNTBLANK in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Statistical.php \PHPExcel_Calculation_Statistical::COUNTBLANK()

* COUNTBLANK * * Counts the number of empty cells within the list of arguments * * Excel Function: * COUNTBLANK(value1[,value2[, ...]]) * * @access public * @category Statistical Functions *

Parameters

mixed $arg,... Data values: * @return int

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Statistical.php, line 1231

Class

PHPExcel_Calculation_Statistical
PHPExcel_Calculation_Statistical

Code

public static function COUNTBLANK() {

  // Return value
  $returnValue = 0;

  // Loop through arguments
  $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
  foreach ($aArgs as $arg) {

    // Is it a blank cell?
    if (is_null($arg) || is_string($arg) && $arg == '') {
      ++$returnValue;
    }
  }

  // Return
  return $returnValue;
}