Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
Solved

# formula to produce all combinations of values in a column

Posted on 2013-06-12
Medium Priority
219 Views
In column A I have values from row 1 to row 60.  I need a formula to generate all of the combinations of the values in column A, which can be written in cell B1 and then copies down column B.

Example:

A1 = 1
A2 = 2
A3 = 3
A4 = 4

So,

B1 = A1+A1 = 2
B2 = A1+A2 = 3
B3 = A1+A3 = 4
B4 = A1+A4 = 5
B5 = A2+A2 = 4
B6 = A2+A3 = 5
B7 = A2+A4 = 6
B8 = A3+A3 = 6
B9 = A3+A4 = 7
B10 = A4+A4 = 8

I need a formula I can enter in cell B1 and copy down the column until all combinations have been computed.

Thanks.
0
Question by:pwflexner
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

Author Comment

ID: 39242877
I'm not sure how tough this question is, and thus how many points to assign it...
0

LVL 41

Expert Comment

ID: 39243926
What about the formula from B11 onwards?do you want to repeat the same pattern?
0

LVL 50

Expert Comment

ID: 39243974
Hello,

this would be much easier with a matrix instead of a formula in a column.

With values in A1 to A60, copy these values to another sheet, starting with the first value in A2, not A1. Paste the same clipboard content of the 60 cells into cells B1 to BI1 with the Paste Special > Transpose option.

Then you can use a formula like this in cell B2

=\$A2+B\$1

copy down and across. You will have a matrix with 3600 cells.

cheers, teylyn
0

LVL 14

Accepted Solution

JP earned 1200 total points
ID: 39244261
Try the attached file, I created a macro that will build the formulas for you.
Create-Formulas.xlsm
0

Author Closing Comment

ID: 39245137
Thanks to all, but peetjh's solution worked best for me.  Very elegant!!
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
###### Suggested Courses
Course of the Month8 days, 20 hours left to enroll