You are here

public static function PHPExcel_Calculation_Statistical::COUNTA 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::COUNTA()

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

Parameters

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

2 calls to PHPExcel_Calculation_Statistical::COUNTA()
PHPExcel_Calculation_Database::DCOUNTA in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Database.php
* DCOUNTA * * Counts the nonblank cells in a column of a list or database that match conditions that you specify. * * Excel Function: * DCOUNTA(database,[field],criteria) * * @access public * @category Database Functions *
PHPExcel_Calculation_MathTrig::SUBTOTAL in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/MathTrig.php
* SUBTOTAL * * Returns a subtotal in a list or database. * *

File

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

Class

PHPExcel_Calculation_Statistical
PHPExcel_Calculation_Statistical

Code

public static function COUNTA() {

  // Return value
  $returnValue = 0;

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

    // Is it a numeric, boolean or string value?
    if (is_numeric($arg) || is_bool($arg) || is_string($arg) && $arg != '') {
      ++$returnValue;
    }
  }

  // Return
  return $returnValue;
}