How to Sum All Possible Combinations in Excel – 4 Steps

Step 1 – Initiating the Solver Add-in

Make sure your Solver Add-in feature is active.

  • Go to File > Options.
  • Select Add-Ins and click Solver Add-in in Inactive Application Add-ins.
  • Click Go.

How to Sum all Possible Combinations

  • In the Add-ins dialog box, click  Solver Add-in.
  • Click OK to install the add-in.


Step 2 – Using the SUMPRODUCT Function

This is the sample dataset.

There are different numbers in column B. Set the SUMPRODUCT formula In column D and the Result column will show combinations of numbers for a specific sum.

Sum all Possible Combinations

Enter the following formula in D5 and press ENTER.

=SUMPRODUCT(C5:C10,B5:B10)

D5 displays 0.

Sum all Possible Combinations

Read More: How to Generate All Possible Combinations of a Set of Numbers in Excel


Step 3 – Using the Solver Add-in Feature

  • Click Solver in the Data tab.

In the Solver Parameters dialog box:

  • In Set Objective, select $D$5 (the cell with the SUMPRODUCT formula).
  • In To, select Value Of, and enter your sum value. Here, 100.
  • In By Changing Variable Cells, select $C$5:$C$10.
  • Click Add to add a constraint.

Sum all Possible Combinations

  • Select $C$5:$C$10 in Cell Reference and bin from the drop-down box and click OK.

  • In the Solver Parameters window, click Solve.

In the Solver Results window:

  • Select Keep Solver Solution and click OK.

Sum all Possible Combinations

The result is displayed in binary. The 1’s are the numbers that will sum up to 100.


Step 4 – Changing the Sum Value

 

  • Click Solver in the Data tab.
  • In To, enter the sum as 150 and click Solve.

Sum all Possible Combinations

The combination of numbers that sum up to 150 is displayed.

Note: this process shows only one combination.


Download Practice Workbook

Download and practice.


Related Articles


<< Go Back to Excel COMBIN Function | Excel Functions | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Sourav Kundu
Sourav Kundu

Sourav Kundu, BSc, Naval Architecture & Marine Engineering, Bangladesh University of Engineering and Technology, is a dedicated technical content creator of the ExcelDemy project. He has a keen interest in Excel and he leverages his problem-solving skills to provide solutions on user interface with Excel. In his position as an Excel & VBA Content Developer at ExcelDemy, Sourav Kundu not only adeptly addresses challenging issues but also demonstrates enthusiasm and expertise in navigating complex situations. Apart from creating... Read Full Bio

4 Comments
  1. Superb!Thank you, saved me ages of clicking through all the combinations!

  2. Hi, how to know all the possibilities sums? i have 100 itens and my product sum have one or more valid result.

    • Hi there, Mr. Ronaldo!
      Thanks for sharing your problem with us.

      Excel’s Solver tool is designed for optimizing mathematical problems, not exhaustively finding all the possibilities sums. While Solver can search for combinations meeting a target, it might not guarantee all solutions, especially in complex cases. Solver’s algorithms might find suitable solutions, but they might not explore all combinations.

      For finding all possible combinations leading to a fixed result, especially with many variables (like you have 100 items), Solver may not be the best option. Consider alternatives like custom Excel VBA macros or external programming languages like Python.

      Regards
      ExcelDemy Team

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo