{"record":{"id":"ab921311c128dfa5","repo":"PHPOffice/PhpSpreadsheet","slug":"value-ab9213","errorCode":"#VALUE!","errorMessage":"#VALUE!","messagePattern":"#VALUE!","errorType":"error_code","errorClass":"PhpOffice\\PhpSpreadsheet\\Calculation\\Exception","httpStatus":null,"severity":"error","filePath":"src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/NonPeriodic.php","lineNumber":314,"sourceCode":"            }\n            if ($rate <= -1.0) {\n                $xnpv += -abs($values[$i] + 0) / (-1 - $rate) ** ($dif / 365);\n            } else {\n                $xnpv += $values[$i] / (1 + $rate) ** ($dif / 365);\n            }\n        }\n\n        return is_finite($xnpv) ? $xnpv : ExcelError::VALUE();\n    }\n\n    /**\n     * @param mixed[] $values\n     * @param mixed[] $dates\n     */\n    private static function validateXnpv(mixed $rate, array $values, array $dates): void\n    {\n        if (!is_numeric($rate)) {\n            throw new Exception(ExcelError::VALUE());\n        }\n        $valCount = count($values);\n        if ($valCount != count($dates)) {\n            throw new Exception(ExcelError::NAN());\n        }\n        if (count($values) > 1 && ((min($values) > 0) || (max($values) < 0))) {\n            throw new Exception(ExcelError::NAN());\n        }\n    }\n}\n","sourceCodeStart":296,"sourceCodeEnd":325,"githubUrl":"https://github.com/PHPOffice/PhpSpreadsheet/blob/65b080eef4d9fd11a5796135ab145883e5c3d6a6/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/NonPeriodic.php#L296-L325","documentation":"Error \"#VALUE!\" thrown in PHPOffice/PhpSpreadsheet.","triggerScenarios":"Thrown at src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/NonPeriodic.php:314 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"65b080eef4d9fd11a5796135ab145883e5c3d6a6","analyzedAt":"2026-08-17T05:40:41.646Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}