diff options
-rw-r--r-- | sc/qa/unit/data/functions/financial/fods/nper.fods | 36 | ||||
-rw-r--r-- | sc/source/core/tool/interpr2.cxx | 2 |
2 files changed, 27 insertions, 11 deletions
diff --git a/sc/qa/unit/data/functions/financial/fods/nper.fods b/sc/qa/unit/data/functions/financial/fods/nper.fods index 22c06f914a25..2eac9b8f339f 100644 --- a/sc/qa/unit/data/functions/financial/fods/nper.fods +++ b/sc/qa/unit/data/functions/financial/fods/nper.fods @@ -1528,20 +1528,20 @@ <table:table-cell table:number-columns-repeated="9"/> </table:table-row> <table:table-row table:style-name="ro6"> - <table:table-cell table:style-name="ce48" table:formula="of:=NPER(0.06/52; 0; 8000; 0 ;2)" office:value-type="string" office:string-value="" calcext:value-type="error"> - <text:p>Err:502</text:p> + <table:table-cell table:formula="of:=NPER(0.06; 0; -80; 400 ;2)" office:value-type="float" office:value="27.6208695898296" calcext:value-type="float"> + <text:p>27.6208695898296</text:p> </table:table-cell> - <table:table-cell table:formula="of:#ERR502!" office:value-type="string" office:string-value="" calcext:value-type="error"> - <text:p>Err:502</text:p> + <table:table-cell office:value-type="float" office:value="27.6208695898296" calcext:value-type="float"> + <text:p>27.6208695898296</text:p> </table:table-cell> - <table:table-cell table:style-name="ce53" table:formula="of:=ORG.OPENOFFICE.ERRORTYPE([.A12])=502" office:value-type="boolean" office:boolean-value="true" calcext:value-type="boolean"> - <text:p>TRUE</text:p> + <table:table-cell table:style-name="ce51" table:formula="of:=ROUND([.A12];12)=ROUND([.B12];12)" office:value-type="boolean" office:boolean-value="true" calcext:value-type="boolean"> + <text:p>WAAR</text:p> </table:table-cell> - <table:table-cell table:formula="of:=FORMULA([.A12])" office:value-type="string" office:string-value="=NPER(0.06/52, 0, 8000, 0 ,2)" calcext:value-type="string"> - <text:p>=NPER(0.06/52, 0, 8000, 0 ,2)</text:p> + <table:table-cell table:formula="of:=FORMULA([.A12])" office:value-type="string" office:string-value="=NPER(0.06; 0; -80; 400 ;2)" calcext:value-type="string"> + <text:p>=NPER(0,06; 0; -80; 400 ;2)</text:p> </table:table-cell> <table:table-cell office:value-type="string" calcext:value-type="string"> - <text:p>No payment, no result</text:p> + <text:p>future value achieved with interest from present value</text:p> </table:table-cell> <table:table-cell table:number-columns-repeated="4"/> <table:table-cell table:style-name="ce20" table:number-columns-repeated="2"/> @@ -1570,6 +1570,24 @@ <table:table-cell table:number-columns-repeated="6"/> </table:table-row> <table:table-row table:style-name="ro6"> + <table:table-cell table:formula="of:=NPER(0.06; 0; 80; 400 ;2)" office:value-type="string" office:string-value="" calcext:value-type="error"> + <text:p>#NUM!</text:p> + </table:table-cell> ++ <table:table-cell office:value-type="string" calcext:value-type="string"> ++ <text:p>#NUM!</text:p> + </table:table-cell> + <table:table-cell table:style-name="ce26" table:formula="of:=ISERROR([.A14])" office:value-type="boolean" office:boolean-value="true" calcext:value-type="boolean"> + <text:p>WAAR</text:p> + </table:table-cell> + <table:table-cell table:formula="of:=FORMULA([.A14])" office:value-type="string" office:string-value="=NPER(0,06; 0; 80; 400 ;2)" calcext:value-type="string"> + <text:p>=NPER(0,06; 0; 80; 400 ;2)</text:p> + </table:table-cell> + <table:table-cell office:value-type="string" calcext:value-type="string"> + <text:p>future value cannot be achieved with interest from present value</text:p> + </table:table-cell> + <table:table-cell table:number-columns-repeated="15"/> + </table:table-row> + <table:table-row table:style-name="ro6"> <table:table-cell table:style-name="ce21"/> <table:table-cell/> <table:table-cell table:style-name="ce26"/> diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index 72a8777e6149..588932de9162 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -2004,8 +2004,6 @@ void ScInterpreter::ScNper() // amount to be paid to get from fPV to fFV is fFV_+_fPV. if ( fPV + fFV == 0.0 ) PushDouble( 0.0 ); - else if ( fPmt == 0.0 ) - PushIllegalArgument(); // No payment, future value can never be reached else if (fInterest == 0.0) PushDouble(-(fPV + fFV)/fPmt); else if (bPayInAdvance) |