Created attachment 154900 [details] issue_solver.ods Please open the attached spreadsheet. It contains all steps... Version: 6.3.2.2 Build-ID: 98b30e735bda24bc04ab42594c85f7fd8be07b9c CPU-Threads: 8; BS: Linux 4.4; UI-Render: Standard; VCL: gtk2; Gebietsschema: de-DE (de_DE.UTF-8); UI-Sprache: de-DE Calc: threaded
Yep, as described Version: 6.1.6.3 Build ID: 6.1.6.3-4.fc29 CPU threads: 8; OS: Linux 5.2; UI render: default; VCL: kde4; Locale: en-US (en_US.UTF-8); Calc: group threaded
@Katarina: Thanks for confirming. I think a patch should NOT be very complicated...
The bug still exists. I have track it to two possible reasons: m_success = (m_objectiveCell.getError() == 0 && checkConstraints()); The model has no constraints. It seems that some fake error appears in the objective cell.
Created attachment 174132 [details] Test file with missing values in the constraints range.
Created attachment 174133 [details] Test setup screen 1.
Created attachment 174134 [details] Test setup screen 2.
Created attachment 174135 [details] Test setup screen 3.
Created attachment 174136 [details] Test setup screen 4.
Created attachment 174137 [details] Test setup screen 5.
Created attachment 174138 [details] Test setup screen 6.
Created attachment 174139 [details] Test setup screen 7.
Created attachment 174140 [details] Test setup screen 8.
Created attachment 174141 [details] Test setup screen 9.
I have checked the functions calls and the problem comes from the fact that the exact value is searched. https://github.com/LibreOffice/core/blob/2484de6728bd11bb7949003d112f1ece2223c7a1/sc/source/ui/miscdlgs/optsolver.cxx#L966 The equality target is converted to extra constraint, which gives not found solution after that. if ( m_xRbValue->get_active() ) { // handle "value of" with an additional constraint (and then minimize) sheet::SolverConstraint aConstraint; aConstraint.Left = aObjective; aConstraint.Operator = sheet::SolverConstraintOperator_EQUAL; OUString aValStr = m_xEdTargetValue->GetText(); ScRange aRightRange; if ( ParseRef( aRightRange, aValStr, false ) ) aConstraint.Right <<= table::CellAddress( aRightRange.aStart.Tab(), aRightRange.aStart.Col(), aRightRange.aStart.Row() ); else { sal_uInt32 nFormat = 0; //! explicit language? double fValue = 0.0; if ( mrDoc.GetFormatTable()->IsNumberFormat( aValStr, nFormat, fValue ) ) aConstraint.Right <<= fValue; else { ShowError( false, m_xEdTargetValue.get() ); return false; } } aConstraints.realloc( nConstrPos + 1 ); aConstraints[nConstrPos++] = aConstraint; } The problem does not exists if target is converted to minimization of absolute difference.
Created attachment 175778 [details] Minimization of absolute difference.