How to Find Excel Number Combinations That Equal a Target Sum
Question details
The user needs to identify which specific numbers from a given list add up to a desired target total.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Performing financial reconciliation, invoice matching, or mathematical problem solving where a subset of values must precisely match a known total.
- Observed behavior
- The user wants to find matching combinations but notes that the Goal Seek feature is unsuitable because it only alters one variable. They require a method using Solver or VBA that handles multiple selections simultaneously.
Ensure you have the Solver Add-in enabled by navigating to File > Options > Add-Ins. If you plan to use the macro method, verify that the Developer tab is visible on your Excel ribbon.
Use the Excel Solver Add-in to Find a Single Combination
The Solver add-in is ideal for smaller lists of numbers. By using binary variables (0 or 1), Solver can quickly identify one specific combination that adds up to your target value.
This method requires setting up an adjacent column to act as a multiplier (0 means the number is excluded, 1 means it is included) and using a SUMPRODUCT formula to calculate the total of the selected numbers.
List your numbers in column A (e.g., A2:A20). In column B (B2:B20), enter the number 0 next to each value. This will be your changing variable column.
In an empty cell (e.g., C2), enter the formula =SUMPRODUCT(A2:A20, B2:B20). This cell will display the current sum based on the 0 or 1 multipliers.
Go to the Data tab on the Excel ribbon and click on 'Solver' in the Analyze group.
Set the 'Set Objective' box to your SUMPRODUCT cell (C2). Choose 'Value Of' and enter your target sum (e.g., 39). Set 'By Changing Variable Cells' to your column B range (B2:B20).
Click 'Add' next to the 'Subject to the Constraints' box. Select your column B range (B2:B20) for the Cell Reference, choose 'bin' from the middle drop-down menu, and click OK.
Click the 'Solve' button. Excel will alter the 0s to 1s for the numbers that match your target sum. Click OK to keep the solver solution.

Use a VBA Macro to Find All Possible Combinations
If you are working with a larger list (up to about 100 numbers) or need to see every possible combination that equals the target, running a specialized VBA procedure is the most effective approach.
Easily Solve Complex Data Combinations in WPS Spreadsheet
WPS Spreadsheet features built-in advanced data analysis tools and robust VBA macro support, enabling you to effortlessly tackle target sum combinations and complex data scenarios without expensive software.
- 1. Download and install WPS Office: Get the free WPS Office suite from the official website and easily install it on your device.
- 2. Open your data list: Launch WPS Spreadsheet and open your existing Excel file containing the list of numbers.
- 3. Utilize Solver or VBA: Navigate to the Data tab to access the built-in optimization tools, or use the Developer tab to run your combination-finding macros.

Frequently Asked Questions
Why can't I use Goal Seek to find number combinations?
Goal Seek is strictly designed to adjust only one variable cell to achieve a specific target result. Finding a combination of numbers requires evaluating and changing multiple variables (inclusion or exclusion of several numbers) simultaneously, making Solver or VBA necessary.
How do I enable the Solver Add-in if I don't see it on the Data tab?
Go to File > Options > Add-Ins. At the bottom of the window, ensure 'Excel Add-ins' is selected in the Manage drop-down and click 'Go'. Check the box next to 'Solver Add-in' and click OK. The Solver tool will now appear on the Data tab.
Will Solver find every possible combination that equals the target?
No, Solver is designed to find a single feasible solution. Once it identifies one combination of numbers that matches your target sum, it stops calculating. To view all possible combinations, you must use a VBA macro.
What happens if no combination equals my exact target?
If there is no mathematical combination of the provided numbers that perfectly matches your target sum, Solver will return a dialog box stating 'Solver could not find a feasible solution.' Ensure your target number and data list are correct.




