Use Excel Solver to Find the Best Combination of Number Multiples
Question details
Find nonnegative integer multipliers for a list of source numbers so their weighted total reaches or exceeds a target while using the fewest terms, the smallest excess, or both.

- Product
- Microsoft Excel Solver
- Device & OS
- not provided
- Scenario
- The user needs to select repeated multiples of available numbers to meet a target total, such as 18,000, through integer optimization.
- Observed behavior
- A manual search through possible repeated-number combinations is difficult, especially when the user must compare both the number of terms and the amount above the target.
Arrange the available source numbers in one contiguous column or row, with an adjacent blank range for their multipliers. Make sure the Solver add-in is enabled in Excel through File > Options > Add-ins before creating the model.
Minimize the number of terms with integer constraints in Excel Solver
Use this method when the main goal is to reach or exceed the target with the fewest selected number multiples.
Create one formula for the weighted total and another for the total number of selected terms. Solver changes only the multiplier cells, which must be nonnegative integers.
Enter the available numbers in a range such as A2:A10. In B2:B10, enter starting multiplier values such as 0; each cell in this range represents how many times its matching source number can be used.
In a total cell, such as D2, enter =SUMPRODUCT(A2:A10,B2:B10). This formula calculates the sum of each source number multiplied by its multiplier.
In another cell, such as D3, enter =SUM(B2:B10). This returns the total count of selected terms, including repetitions.
Go to Data > Solver. Set the objective cell to D3, choose Min, and set By Changing Variable Cells to B2:B10.
Select Add and set D2 >= 18000, replacing 18000 with your target if needed. Add B2:B10 = int and B2:B10 >= 0. Choose Simplex LP where available, then select Solve and keep the solution.

Run Solver again to minimize excess after finding the minimum term count
Use this second optimization when multiple combinations use the same minimum number of terms and you want the total closest to the target without falling below it.
Use WPS Spreadsheets Solver for Integer Combination Optimization
WPS Spreadsheets can build the same weighted-sum model with SUMPRODUCT and SUM, then use Solver to test nonnegative integer multipliers. Set a target constraint, minimize the number of terms, and optionally run a second model to minimize excess.
- 1. Enter values and multiplier cells: In WPS Spreadsheets, place source values in one range and enter 0 as the starting value in an adjacent multiplier range.
- 2. Add total formulas: Use =SUMPRODUCT(value_range,multiplier_range) for the achieved total and =SUM(multiplier_range) for the number of terms.
- 3. Open Solver: Select Data > Solver and choose the term-count formula cell as the objective to minimize.
- 4. Add optimization constraints: Set the weighted-total cell to be greater than or equal to the target, then set the multiplier range as integers and greater than or equal to 0.
- 5. Solve and refine excess if needed: Run Solver, then fix the returned minimum term count and minimize a separate total-minus-target formula to find the closest valid result.

Frequently Asked Questions
What formula calculates a total from values and their multipliers?
Use SUMPRODUCT, such as =SUMPRODUCT(A2:A10,B2:B10). The first range contains the available values and the second range contains the corresponding multipliers.
How do I prevent Solver from returning decimal multipliers?
In the Solver Parameters window, select Add, choose the multiplier range, and apply the int constraint. Also add a >= 0 constraint so Solver cannot use negative multipliers.
How can I make the total at least 18,000 instead of exactly 18,000?
Add a Solver constraint for the weighted-total cell, such as D2 >= 18000. Solver can then return a valid total above 18,000 when an exact match is not possible.
Why should I minimize the number of terms and excess in separate Solver runs?
The fewest terms and the smallest excess can conflict. First minimize the SUM of the multipliers, then set that result as an equality constraint and minimize the excess formula.
Which Solver method should I use for this model?
Use Simplex LP when the total and objective formulas are linear, such as SUMPRODUCT and SUM, and apply integer constraints to the multiplier cells. If your model includes non-linear formulas, use an appropriate non-linear Solver method instead.




