{"record":{"id":"9bb23606dfd2746b","repo":"PHPOffice/PhpSpreadsheet","slug":"num-9bb236","errorCode":"#NUM!","errorMessage":"#NUM!","messagePattern":"#NUM!","errorType":"error_code","errorClass":"PhpOffice\\PhpSpreadsheet\\Calculation\\Exception","httpStatus":null,"severity":"error","filePath":"src/PhpSpreadsheet/Calculation/Financial/Depreciation.php","lineNumber":210,"sourceCode":"            $period = self::validatePeriod($period);\n        } catch (Exception $e) {\n            return $e->getMessage();\n        }\n\n        if ($period > $life) {\n            return ExcelError::NAN();\n        }\n\n        $syd = (($cost - $salvage) * ($life - $period + 1) * 2) / ($life * ($life + 1));\n\n        return $syd;\n    }\n\n    private static function validateCost(mixed $cost, bool $negativeValueAllowed = false): float\n    {\n        $cost = FinancialValidations::validateFloat($cost);\n        if ($cost < 0.0 && $negativeValueAllowed === false) {\n            throw new Exception(ExcelError::NAN());\n        }\n\n        return $cost;\n    }\n\n    private static function validateSalvage(mixed $salvage, bool $negativeValueAllowed = false): float\n    {\n        $salvage = FinancialValidations::validateFloat($salvage);\n        if ($salvage < 0.0 && $negativeValueAllowed === false) {\n            throw new Exception(ExcelError::NAN());\n        }\n\n        return $salvage;\n    }\n\n    private static function validateLife(mixed $life, bool $negativeValueAllowed = false): float\n    {\n        $life = FinancialValidations::validateFloat($life);","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/PHPOffice/PhpSpreadsheet/blob/65b080eef4d9fd11a5796135ab145883e5c3d6a6/src/PhpSpreadsheet/Calculation/Financial/Depreciation.php#L192-L228","documentation":"Error \"#NUM!\" thrown in PHPOffice/PhpSpreadsheet.","triggerScenarios":"Thrown at src/PhpSpreadsheet/Calculation/Financial/Depreciation.php:210 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"}