public static function PHPExcel_Calculation_Statistical::MINIF in Loft Data Grids 7.2
Same name and namespace in other branches
- 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Statistical.php \PHPExcel_Calculation_Statistical::MINIF()
* MINIF * * Returns the minimum value within a range of cells that contain numbers within the list of arguments * * Excel Function: * MINIF(value1[,value2[, ...]],condition) * * @access public * @category Mathematical and Trigonometric Functions *
Parameters
mixed $arg,... Data values: * @param string $condition The criteria that defines which cells will be checked. * @return float
File
- vendor/
phpoffice/ phpexcel/ Classes/ PHPExcel/ Calculation/ Statistical.php, line 2369
Class
- PHPExcel_Calculation_Statistical
- PHPExcel_Calculation_Statistical
Code
public static function MINIF($aArgs, $condition, $sumArgs = array()) {
// Return value
$returnValue = null;
$aArgs = PHPExcel_Calculation_Functions::flattenArray($aArgs);
$sumArgs = PHPExcel_Calculation_Functions::flattenArray($sumArgs);
if (empty($sumArgs)) {
$sumArgs = $aArgs;
}
$condition = PHPExcel_Calculation_Functions::_ifCondition($condition);
// Loop through arguments
foreach ($aArgs as $key => $arg) {
if (!is_numeric($arg)) {
$arg = PHPExcel_Calculation::_wrapResult(strtoupper($arg));
}
$testCondition = '=' . $arg . $condition;
if (PHPExcel_Calculation::getInstance()
->_calculateFormulaValue($testCondition)) {
if (is_null($returnValue) || $arg < $returnValue) {
$returnValue = $arg;
}
}
}
// Return
return $returnValue;
}