diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx index 3699a3990e84..62568eebfb5c 100644 --- a/sc/source/core/tool/interpr3.cxx +++ b/sc/source/core/tool/interpr3.cxx @@ -3850,7 +3850,7 @@ void ScInterpreter::CalculatePearsonCovar( bool _bPearson, bool _bStexy, bool _b } } } - if (fCount < (_bStexy ? 3.0 : (_bSample ? 2.0 : 1.0))) // fCount==1 is handled by checking denominator later on + if (fCount < (_bStexy ? 3.0 : (_bSample ? 2.0 : 1.0))) PushNoValue(); else { @@ -3872,7 +3872,7 @@ void ScInterpreter::CalculatePearsonCovar( bool _bPearson, bool _bStexy, bool _b } } } - } // for (SCSIZE i = 0; i < nC1; i++) + } if ( _bPearson ) { if (fSumSqrDeltaX == 0.0 || ( !_bStexy && fSumSqrDeltaY == 0.0) ) @@ -3882,7 +3882,7 @@ void ScInterpreter::CalculatePearsonCovar( bool _bPearson, bool _bStexy, bool _b fSumDeltaXDeltaY / fSumSqrDeltaX) / (fCount-2))); else PushDouble( fSumDeltaXDeltaY / sqrt( fSumSqrDeltaX * fSumSqrDeltaY)); - } // if ( _bPearson ) + } else { if ( _bSample )