You are here

public static function PHPExcel_Calculation_MathTrig::SUM in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/MathTrig.php \PHPExcel_Calculation_MathTrig::SUM()

* SUM * * SUM computes the sum of all the values and cells referenced in the argument list. * * Excel Function: * SUM(value1[,value2[, ...]]) * * @access public * @category Mathematical and Trigonometric Functions *

Parameters

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

2 calls to PHPExcel_Calculation_MathTrig::SUM()
PHPExcel_Calculation_Database::DSUM in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Database.php
* DSUM * * Adds the numbers in a column of a list or database that match conditions that you specify. * * Excel Function: * DSUM(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/MathTrig.php, line 1127

Class

PHPExcel_Calculation_MathTrig
PHPExcel_Calculation_MathTrig

Code

public static function SUM() {

  // Return value
  $returnValue = 0;

  // Loop through the arguments
  foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) {

    // Is it a numeric value?
    if (is_numeric($arg) && !is_string($arg)) {
      $returnValue += $arg;
    }
  }

  // Return
  return $returnValue;
}