Solved

formula to produce all combinations of values in a column

Posted on 2013-06-12
5
168 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 40

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:teylyn
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now