Solved

formula to produce all combinations of values in a column

Posted on 2013-06-12
5
209 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
[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
  • Learn & ask questions
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
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

717 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