This might help. https://math.stackexchange.com/questions/1462099/number-of-possible-combinations-of-x-numbers-that-sum-to-y Answer from MattyPKing on reddit.com
🌐
Reddit
reddit.com › r/googlesheets › how to find all combinations that equal a given sum in sheets?
r/googlesheets on Reddit: How To Find All Combinations That Equal A Given Sum in Sheets?
October 26, 2022 -

For example:

I've got a value of 15 and I want to see what 9 number values can go into 15. By hand I generate it this way:

(Note: Maximum Value can be 5 (Increments bigger later on), Minimum Value can be 0)

555000000
554100000
553200000
553110000

As you can see this can be tedious to do long hand. Especially considering that I have to do this for values 15 - 51.

I've been using the Transpose function to transpose arrays I've created before, but that was to transpose an array into a Random order:

=TRANSPOSE(SORTN(TRANSPOSE(B22:I22),8,,RANDARRAY(8),))

Looking for an Excel answer I came across this, but it uses an Add-On to do so:

https://www.extendoffice.com/documents/excel/3557-excel-find-all-combinations-that-equal-given-sum.html

Why I'm doing this?

I'm personally creating a character generator for Chronicles of Darkness Generic Monsters. Monster traits are numeric values with a trait limit of 5 at Lvl 1 which goes up to 10 at lvl 6 and doesn't increase from lvl 6 to 10. The total value of traits to distribute at lvl 1 is between 15-18, 19-22 at Lvl 2, 23-26 at lvl 3, etc... increasing by 4 each level till lvl 10 where its anything over 51 (But this doesn't have to be included in my generator).

If you have any questions feel free to ask.

Top answer
1 of 3
7

If A2:A18 had the 17 numbers,

B1(heading):

=TRANSPOSE(A2:A18)

B2:

=ARRAYFORMULA(A2:A18+TRANSPOSE(A2:A18))

This will give a 17*17 table of SUM of all different combinations:

    1   2   3   4   5   6   7   8   9   10  11  12  13  14  15  16  17
1   2   3   4   5   6   7   8   9   10  11  12  13  14  15  16  17  18
2   3   4   5   6   7   8   9   10  11  12  13  14  15  16  17  18  19
3   4   5   6   7   8   9   10  11  12  13  14  15  16  17  18  19  20
4   5   6   7   8   9   10  11  12  13  14  15  16  17  18  19  20  21
5   6   7   8   9   10  11  12  13  14  15  16  17  18  19  20  21  22
6   7   8   9   10  11  12  13  14  15  16  17  18  19  20  21  22  23
7   8   9   10  11  12  13  14  15  16  17  18  19  20  21  22  23  24
8   9   10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25
9   10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26
10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27
11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28
12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29
13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30
14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31
15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32
16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33
17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34

2 of 3
2

If all you need are pairs of values, then use this simpler macro:

Sub PairsOnly()
    Dim Items(1 To 17) As Variant
    Dim i As Long, j As Long, k As Long
    Dim lower As Long, upper As Long
    lower = LBound(Items)
    upper = UBound(Items)
    k = 2

    For i = lower To upper
        Items(i) = Cells(1, i)
    Next i

    For i = lower To upper - 1
        For j = i + 1 To upper
            Cells(k, 1) = Items(i) & "," & Items(j)
            Cells(k, 2) = Items(i) + Items(j)
            k = k + 1
        Next j
    Next i
End Sub

Discussions

google sheets - Combinations to find a given sum - Web Applications Stack Exchange
A good enough solution is possible ... practically be calculated using plain vanilla spreadsheet formulas. To understand why, see the new 'Simple subsets' sheet in your sample spreadsheet. It finds 153 different ways to combine exactly three terms so that their sum is 40 (including ... More on webapps.stackexchange.com
🌐 webapps.stackexchange.com
December 22, 2021
Find combinations of number that add up to a specified sum in google sheets - Stack Overflow
I have a column in which numbers are written. I need from these numbers to find all combinations of 2,3,4,5 numbers that will give a certain sum with max. deviation -1% Is it even possible to do t... More on stackoverflow.com
🌐 stackoverflow.com
Google Sheets - Indicate which cells sum a value - Google Docs Editors Community
Skip to main content · Google Docs Editors Help · Sign in · Google Help · Help Center · Community · Google Docs Editors · Terms of Service · Submit feedback · Send feedback on More on support.google.com
🌐 support.google.com
June 3, 2019
find a combination of numbers that equal a given sum
Hi, If I have A1 = 1, A2 = 3, A3 = 5, A4 = 7, and A5 = 9 in column A, Would someone know how to get the combination of numbers in column A that equal 13... More on mrexcel.com
🌐 mrexcel.com
18
0
December 18, 2007
People also ask

What is the SUM function in Google Sheets?
The SUM function in Google Sheets calculates the sum of a range of numbers or individual values. It's used to quickly calculate the total of selected cells, providing an easy way to perform basic arithmetic operations on numeric data.
🌐
owox.com
owox.com › blog › articles › google sheets tips › a detailed guide to sum, sumif, and sumifs functions in google sheets
Detailed Guide to SUM, SUMIF, and SUMIFS in Google Sheets for 2025
How to use the SUM formula in Google Sheets?
To use the SUM formula in Google Sheets, type =SUM(range) into a cell, where "range" represents the cells you want to add together. For example, =SUM(A1:A10) will add all values from cells A1 to A10.
🌐
owox.com
owox.com › blog › articles › google sheets tips › a detailed guide to sum, sumif, and sumifs functions in google sheets
Detailed Guide to SUM, SUMIF, and SUMIFS in Google Sheets for 2025
Why is the SUM formula beneficial in Google Sheets?
The SUM formula in Google Sheets simplifies data aggregation by quickly totaling a range of numbers. It eliminates the need for manual calculations, reduces errors, and enhances efficiency when working with large datasets or performing repetitive tasks.
🌐
owox.com
owox.com › blog › articles › google sheets tips › a detailed guide to sum, sumif, and sumifs functions in google sheets
Detailed Guide to SUM, SUMIF, and SUMIFS in Google Sheets for 2025
🌐
The Bricks
thebricks.com › resources › guide-how-to-find-all-combinations-that-equal-a-given-sum-in-google-sheets
How to Find All Combinations That Equal a Given Sum in Google Sheets
Cell E1: Target Sum -> 1050 Cell E2: Calculated Sum (using SUMPRODUCT) -> =SUMPRODUCT(A2:A10, B2:B10) With your sheet ready, it’s time to tell Solver what to do.
🌐
Stack Overflow
stackoverflow.com › questions › 76005363 › find-combinations-of-number-that-add-up-to-a-specified-sum-in-google-sheets
Find combinations of number that add up to a specified sum in google sheets - Stack Overflow
=arrayformula(let( numbers,$A$2:$A$10, target,$C$2, choose,2, splitdigits,lambda(array,map(array,lambda(each,mid(each,sequence(1,len(each)),1)))), permuts,base(sequence(counta(numbers)^choose,1,0),counta(numbers),choose), splitpermuts,1*splitdigits(permuts), combos,unique(byrow(splitpermuts,lambda(row,join(,large(row,sequence(1,choose)))))), splitcombos,1*splitdigits(combos), combolookup,xlookup(splitcombos,sequence(count(numbers),1,0),numbers), filtercombosbytarget,filter(combolookup,isbetween(byrow(combolookup,lambda(row,sum(row))),0.99*target,1.01*target)), ifna(byrow(filtercombosbytarget,lambda(row,join(", ",row))),"No combos"))) I am assuming repeating combinations are allowed - the logic would need to be changed slightly if this is not the case.
🌐
Owox
owox.com › blog › articles › google sheets tips › a detailed guide to sum, sumif, and sumifs functions in google sheets
Detailed Guide to SUM, SUMIF, and SUMIFS in Google Sheets for 2025
December 10, 2025 - Combining the SUM and FILTER functions in Google Sheets allows you to sum only the values that meet specific criteria. The FILTER function narrows down the dataset to include only the rows that match your conditions, and the SUM function then ...
Find elsewhere
🌐
Google Support
support.google.com › docs › answer › 3093400
COMBIN - Google Docs Editors Help
COMBIN is the standard combinatorics function typically notated nCk and read "n choose k". This is equivalent to FACT(n)/(FACT(k)*FACT(n-k)). MULTINOMIAL: Returns the factorial of the sum of values divided by the product of the values' factorials.
🌐
Ablebits
ablebits.com › ablebits blog › excel › excel macro › find all combinations of numbers that equal a given sum in excel
Find all combinations of numbers that equal a given sum in Excel
July 21, 2023 - If you need to find a combination of numbers with two decimal digits, multiply them by 100 and then divide the numbers in the resulting combination by 100. If the numbers are the result of calculations, be sure to use rounding.
🌐
Microsoft Power BI Community
community.powerbi.com › t5 › Desktop › How-To-Find-A-Combinations-That-Equal-A-Given-Sum › td-p › 2960305
Solved: How To Find A Combinations That Equal A Given Sum - Microsoft Power BI Community
December 10, 2022 - Excel has a built-in function called COMBIN that can be used to generate all possible combinations of numbers from a given list. You can then use the SUM function to check if any of the combinations are equal to the target value.
🌐
Formulas HQ
formulashq.com › sum-google-sheet-formulas-explained
Sum: Google Sheet Formulas Explained - FormulasHQ
January 30, 2024 - To use the SUM function in a pivot ... SUM from the list of summary functions. Google Sheets will automatically calculate the sum for each combination of row and column values, giving you a clear and concise summary of your ...
🌐
Google Support
support.google.com › docs › thread › 7363438 › google-sheets-indicate-which-cells-sum-a-value
Google Sheets - Indicate which cells sum a value - Google Docs Editors Community
June 3, 2019 - Skip to main content · Google Docs Editors Help · Sign in · Google Help · Help Center · Community · Google Docs Editors · Terms of Service · Submit feedback · Send feedback on
🌐
Ablebits
ablebits.com › ablebits blog › google sheets tips › google sheets functions › sumif in google sheets with formula examples
SUMIF in Google Sheets with formula examples
April 17, 2024 - If you know how to use SUMIF in Excel desktop or Excel online, SUMIF in Google Sheets will be a piece of cake for you since both are essentially the same. But don't rush to close this page yet - you may find a few unobvious but very useful SUMIF formulas you didn't know! See the colors, sum the numbers! Sum up cells by their fill color — effortlessly and accurately ... Duplicates? Merge, Sum, Done! Spot duplicates, combine details, and tally totals
🌐
Combinationsumcalculator
combinationsumcalculator.com
Combination Sum Calculator
Find all combinations from a given set of numbers that add up to a given sum.
🌐
MrExcel
mrexcel.com › forums › question forums › excel questions
find a combination of numbers that equal a given sum | MrExcel Message Board
December 18, 2007 - What you then need to do is to ... At the bottom of your column of zeroes (let's say cell B11), put the formula =SUMPRODUCT($A$1:$A$10,$B:$B$10) (I'm just assuming there are only 10 values, of course there could be ...
🌐
Google Support
support.google.com › docs › answer › 9084101
COMBINA function - Google Docs Editors Help
COMBINA(n, k) is equivalent to COMBIN(n+k-1), which can be read as "(n+k-1)choose k" or .
🌐
Pages
combinationsumcalc.pages.dev
Combination Sum Calculator
Enter the desired sum in the input field and all the numbers in the text area. This combination calculator will automatically calculate and display all the possible combinations in realtime.
🌐
Super User
superuser.com › questions › 1749557 › which-formula-should-i-use-to-know-which-numbers-sum-will-come-out-my-exact-resu
google chrome - Which formula should I use to know which numbers sum will come out my exact result in excel - Super User
Go do cell D3 and enter =D1-D2. This cell is the difference between the sum and the sought goal of 809. ... We will tell the solver to trial-and-error combinations of 1s and 0s in each cell in Column B. SUMPRODUCT multiplies each value with ...
🌐
Reddit
reddit.com › r/googlesheets › generate huge list of all possible combinations, then lookup and get sum of values
r/googlesheets on Reddit: Generate huge list of all possible combinations, then lookup and get sum of values
March 28, 2023 -

Please bear with me as I try my best to explain what I'm trying to do...

I want to analyze some data from a video game. The player can equip four types of armor, and each piece of armor has an associated weight value. A simplified example of the data table I'm working with is below.

A B C D E F G H
1 Head Helm Weight Chest Chest Weight Arms Arms Weight Legs Legs Weight
2 Bare head 0.0 Bare chest 0.0 Bare arms 0.0 Bare legs 0.0
3 Hat 0.5 Shirt 1.0 Gloves 0.5 Socks 0.1
4 Helmet 3.0 Jacket 2.0 Boots 1.0
5 Armor 10.0

I'd like to generate a list of all possible combinations of gear that the player can wear, and also find the total weight of all equipped pieces for each permutation. Unfortunately, each category has between 25-50 available items, which means the number of possible combinations is HUGE.

I found that the example here works well for generating the list of combinations. I slightly modified the formula to help separate and identify the items in the resulting string. It takes a long time for the list to fill in, but I think that's going to be a problem no matter what due to the sheer number of results.

=INDEX(FLATTEN(FLATTEN(FLATTEN("{{Head}}"&
 FILTER(A2:A, A2:A<>"")&"{{Chest}}"&TRANSPOSE(
 FILTER(C2:C, C2:C<>"")))&"{{Arms}}"&TRANSPOSE(
 FILTER(E2:E, E2:E<>"")))&"{{Legs}}"&TRANSPOSE(
 FILTER(G2:G, G2:G<>""))))

The formula generates a list that looks like this:

{{Head}}Bare head{{Chest}}Bare chest{{Arms}}Bare arms{{Legs}}Bare legs
{{Head}}Bare head{{Chest}}Bare chest{{Arms}}Bare arms{{Legs}}Socks
{{Head}}Bare head{{Chest}}Bare chest{{Arms}}Bare arms{{Legs}}Boots
{{Head}}Bare head{{Chest}}Bare chest{{Arms}}Gloves{{Legs}}Bare legs
{{Head}}Bare head{{Chest}}Bare chest{{Arms}}Gloves{{Legs}}Socks
...

Great, step one done. However, once the list is made, I don't know the most efficient way to look up and find the sum of the weights for each combination. I can extract each item from the combined string with some MID and FIND manipulation, and then use VLOOKUP or INDEX/MATCH to get the associated weights, then add them all together. But the formula is clunky and significantly adds to the sheet's already long processing time. A smaller test sample set eventually outputs the information I need, but with the full set of data the sheet takes several minutes to load and eventually crashes. I know for sure that my sheet has enough rows for the list to expand into, so that's not the issue.

I also found this example of a script that does more or less the same thing as the INDEX/FLATTEN/FILTER/TRANSPOSE formula. I thought it might be faster, but testing with a shorter list results in "result too large" error message, so it won't be able to handle my full list. Even if it could handle it, the script assumes all four columns have the same number of rows, so it would still need to be modified. And besides, this doesn't address my need for a better way to extract and add up the weights of each possible combination.

Does anyone have a better idea how to process this mass of information? Is there a better set of formulas I should be using or scripts that can handle my needs without bogging down the sheet to the point that it's unusable?

🌐
MakeUseOf
makeuseof.com › home › productivity › how to sum numbers, cells, or matrices in google sheets
How to Sum Numbers, Cells, or Matrices in Google Sheets
January 28, 2022 - You can sum plain numbers using the formula bar in Sheets. Google Sheets will calculate the result and show it in the cell that you typed the formula in.
🌐
Spreadsheet Class
spreadsheetclass.com › home › google sheets formulas › how to add and sum in google sheets (addition and sum function)
How to add and sum in Google Sheets (Addition and SUM function)
August 19, 2024 - Below is a list of products in column A, and the revenue earned from each product listed in column B. We are going to sum the revenue from all of the products, to find the total revenue earned with all products combined. The formula below, is entered into cell B2 for this example. ... As you can see in the image above, the total revenue earned with all products combined, was $6,910. Google Sheets has a unique feature that allows you to make fast calculations without a formula, by simply selecting the cells that contain the data to be calculated and looking on the bottom right of the screen.