Excel Solver
To perform these tasks without using VBA, the solver needs to be used and simple binary logic is used.
Enable Solver in Excel
The version used is Excel 2010.
Enter the Office or File button.
Click Options .
Click Add-Ins .
Install the Solver Add-in and click Ok.
Enable Add-in
Enable Developer Mode
On the Developer tab, click Add-ins
A window will open and the Solver Add-in should be marked.
Solution
Withthedataprovidedintheexample,theA1:A10
cellswerefilled.ThecellB11
ispopulatedwiththeformula=SUMPRODUCT(A1:A10;B1:B10)
or=SOMAPRODUTO(A1:A10;B1:B10)
OpenSolverunderDataInSetObjective,selectthecellB11
.
ChoosetheValueof:optionandenterthedesiredsumnumber.
IntheBychangingVariableCellsoption,choosethecellsB1:B10
.
ClickAdd.
AwindowwillopenandB1:B10
cellsshouldbechosenasareference.Andthebin
optionmustbechosen.ClickOk.
InthesolutionmethodchooseSimplexLP.
ClickOptionsandfillinasshown.
ClickSolveandthenOk.
SolverResults
Filter
Afterthesolversolution,enterafilterforthenumber1
intheB
column.
Result
Withthefilterwecanconcludethatlines3and4arethecoefficientsofthesum.
Extra:
Tochangetheoptimizationfunction,otherformsofobjectivefunctionormoreconstraintscanbeadded.Ifyouwanttodelveintothesubject,lookforLinearProgramming,SimplexMethodorSolver.OrinEnglishLinearProgramming(LP),SimplexorLinearOptimization.AgoodtoolforExceloptimizationproblemsisthe Solver Studio .