Solved

formula to produce all combinations of values in a column

Posted on 2013-06-12
5
203 Views
Last Modified: 2013-06-13
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
Comment
Question by:pwflexner
5 Comments
 

Author Comment

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

Expert Comment

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

Expert Comment

by:Ingeborg Hawighorst
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

by:
peetjh earned 300 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

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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question