How to Return Dynamic Array of Each Sum for 3 or more combinations of numbers?

user47

New Member
Joined
Apr 6, 2013
Messages
17
Office Version
  1. 365
Hello,

Have not seen this posted before so I hope it is not a stupid question.

If I have a column with numbers and I wanted to return the sum of combinations of every 2 numbers I can do the following:

Book1
ABCDEFGH
311977656216796642662339535755
41197723954185391365618619186001593017732
565621853913124824113204131851051512317
6167913656824133588321830256327434
766421861913204832113284132651059512397
866231860013185830213265132461057612378
9395315930105155632105951057679069708
105755177321231774341239712378970811510
Sheet1
Cell Formulas
RangeFormula
B4:H10B4=$A$4:$A$10+TRANSPOSE($A$4:$A$10)
Dynamic array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B7:AT8,B9:K15,R9:AT15,M16:Q22,F46:AT46,AK16:AT45,B4:L6,R4:AT6,M47:AT48Cell Value=$A$2textNO
B7:AT8,B9:K15,R9:AT15,M16:Q22,F46:AT46,AK16:AT45,B4:L6,R4:AT6,M47:AT48Cell ValueduplicatestextNO


Of course these have duplicates off either side of the diagonal- I would just ignore one side and can analyze the other (haven't figured out a way to return only unique values in the table).
But what if I wanted to take it a step further and return the sums for every unique combination of sets of three numbers instead? I can't figure out how to do this in excel except manually which is very time consuming and prone to mistakes. Is this possible? This is just an example but my actual dataset would be about 150 numbers and I need to add them up in 3s or even 4s or 5s. Is there a general formula I can use to do this?

Thanks for any help/ ideas- appreciated as usual!!
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi, is this what you are looking for?

Cell Formulas
RangeFormula
B2:K11B2=IF(ROW(B2)=COLUMN(B2),B$1+$A2,"")
N2:N11N2=IF(ISNUMBER(INDEX($B$2:$K$11,ROW(N2)-1,ROW(N2)-1)),M2+INDEX($B$2:$K$11,ROW(N2)-1,ROW(N2)-1),"")
 
Upvote 0
Hi, is this what you are looking for?

Cell Formulas
RangeFormula
B2:K11B2=IF(ROW(B2)=COLUMN(B2),B$1+$A2,"")
N2:N11N2=IF(ISNUMBER(INDEX($B$2:$K$11,ROW(N2)-1,ROW(N2)-1)),M2+INDEX($B$2:$K$11,ROW(N2)-1,ROW(N2)-1),"")
I just realized your title was for a dynamic array. The above is not that. But it should work, unless you are seeking elegance. :)
 
Upvote 0
How about
Excel Formula:
=LET(d,A4:A10,r,ROWS(d),IF(SEQUENCE(r)>=SEQUENCE(,r),d+TRANSPOSE(d),""))
 
Upvote 0
Hi, is this what you are looking for?

Cell Formulas
RangeFormula
B2:K11B2=IF(ROW(B2)=COLUMN(B2),B$1+$A2,"")
N2:N11N2=IF(ISNUMBER(INDEX($B$2:$K$11,ROW(N2)-1,ROW(N2)-1)),M2+INDEX($B$2:$K$11,ROW(N2)-1,ROW(N2)-1),"")


Hello, thank you for your reply but unfortunately this is not what I was looking for.

Maybe I have not explained my question correctly.

Let me try again: Is there a way to add up every unique combination of say 3 numbers in a list of say 10 numbers (1,2,3,4,5,6,7,8,9,10) and have the sum of them dynamically appear in a range? I can't picture what a table would look like beyond a combination of every 2 numbers as in my first post.

I am having trouble inserting my example as a table for some reason so I have put a picture instead.


1679840939849.png



Hope this defines the problem better- If not let me know and I will try to add further clarity.
Let me know and thank you again for your help!
 
Last edited:
Upvote 0
How about
Excel Formula:
=LET(d,A4:A10,r,ROWS(d),IF(SEQUENCE(r)>=SEQUENCE(,r),d+TRANSPOSE(d),""))
Hello,

This works well for adding 2 numbers- my goal is I am not sure how to add every combination of 3 numbers together and what such a table would look like.
Basically, I'm looking for a 3-numbers-added-together version of your solution.
I have added an example in a reply above if you want to reference that.

Thank you!
 
Upvote 0
Can you post an example of the result you want as the formulae I supplied does what you asked for.
Fluff.xlsm
ABCDEFGH
1
2
311977656216796642662339535755
41197723954
565621853913124
616791365682413358
766421861913204832113284
86623186001318583021326513246
939531593010515563210595105767906
105755177321231774341239712378970811510
Master
Cell Formulas
RangeFormula
B4:H10B4=LET(d,A4:A10,r,ROWS(d),IF(SEQUENCE(r)>=SEQUENCE(,r),d+TRANSPOSE(d),""))
Dynamic array formulas.
 
Upvote 0
Can you post an example of the result you want as the formulae I supplied does what you asked for.
Fluff.xlsm
ABCDEFGH
1
2
311977656216796642662339535755
41197723954
565621853913124
616791365682413358
766421861913204832113284
86623186001318583021326513246
939531593010515563210595105767906
105755177321231774341239712378970811510
Master
Cell Formulas
RangeFormula
B4:H10B4=LET(d,A4:A10,r,ROWS(d),IF(SEQUENCE(r)>=SEQUENCE(,r),d+TRANSPOSE(d),""))
Dynamic array formulas.

Hello,

The formula works well for 2 numbers added up- I am looking for a solution that adds every unique combination of 3 numbers say in a list of 10 numbers.

The mathematical unique number of combinations will be 120 unique sums but I am not sure how to create a list of them in excel in a way that shows each of the sets of the 3 numbers that were summed for the 120 sums. It is difficult for me to give an example as I cannot picture what such a table would look like. I did provide that table of adding every 2 numbers but that was just a simple example and not the problem at hand. It is for 3+ number combinations that I'm stumped about.

This video on youtube shows the closest thing I am looking for but I think it's a paid tool:


Let me know if this helps with my explaining what the issue is.

Thank you.
 
Upvote 0
View attachment 88426

Is this what you are looking for, for a dynamic range?

Hello,

I think it does! Can you help me understand your table a little bit? I think it looks correct although I was not able to follow the addition logic in every cell (you're probably correct as I am just slow at this!) The solution should show the sum of every unique 3-number combination eg, 1+2+3=6, 1+2+4=7, 1+2+5=8 etc. I can see it there for some of the cells but not all (again my limitation not yours!). Would you be mind sharing the formula as I think this was a picture?

Thank you!
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,988
Members
452,373
Latest member
TimReeks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top