You are here

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

* LOGNORMDIST * * Returns the cumulative lognormal distribution of x, where ln(x) is normally distributed * with parameters mean and standard_dev. * *

Parameters

float $value: * @param float $mean * @param float $stdDev * @return float

File

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

Class

PHPExcel_Calculation_Statistical
PHPExcel_Calculation_Statistical

Code

public static function LOGNORMDIST($value, $mean, $stdDev) {
  $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
  $mean = PHPExcel_Calculation_Functions::flattenSingleValue($mean);
  $stdDev = PHPExcel_Calculation_Functions::flattenSingleValue($stdDev);
  if (is_numeric($value) && is_numeric($mean) && is_numeric($stdDev)) {
    if ($value <= 0 || $stdDev <= 0) {
      return PHPExcel_Calculation_Functions::NaN();
    }
    return self::NORMSDIST((log($value) - $mean) / $stdDev);
  }
  return PHPExcel_Calculation_Functions::VALUE();
}