{"record":{"id":"7125d3e2d88fffe6","repo":"PHPOffice/PhpSpreadsheet","slug":"num-7125d3","errorCode":"#NUM!","errorMessage":"#NUM!","messagePattern":"#NUM!","errorType":"error_code","errorClass":"PhpOffice\\PhpSpreadsheet\\Calculation\\Exception","httpStatus":null,"severity":"error","filePath":"src/PhpSpreadsheet/Calculation/Financial/Coupons.php","lineNumber":392,"sourceCode":"\n        $result = Date::excelToDateTimeObject($maturity);\n        $day = (int) $result->format('d');\n        $lastDayFlag = Helpers::isLastDayOfMonth($result);\n\n        while ($settlement < Date::PHPToExcel($result)) {\n            self::monthsDiff($result, $months, '-', $day, $lastDayFlag);\n        }\n        if ($next === true) {\n            self::monthsDiff($result, $months, '+', $day, $lastDayFlag);\n        }\n\n        return (float) Date::PHPToExcel($result);\n    }\n\n    private static function validateCouponPeriod(float $settlement, float $maturity): void\n    {\n        if ($settlement >= $maturity) {\n            throw new Exception(ExcelError::NAN());\n        }\n    }\n}\n","sourceCodeStart":374,"sourceCodeEnd":396,"githubUrl":"https://github.com/PHPOffice/PhpSpreadsheet/blob/65b080eef4d9fd11a5796135ab145883e5c3d6a6/src/PhpSpreadsheet/Calculation/Financial/Coupons.php#L374-L396","documentation":"Error \"#NUM!\" thrown in PHPOffice/PhpSpreadsheet.","triggerScenarios":"Thrown at src/PhpSpreadsheet/Calculation/Financial/Coupons.php:392 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"}