+ Reply to Thread
Results 1 to 6 of 6

Adding/multiplying all combinations of numbers from 2 areas

  1. #1
    Registered User
    Join Date
    02-11-2015
    Location
    Belgium
    MS-Off Ver
    office 2007
    Posts
    3

    Adding/multiplying all combinations of numbers from 2 areas

    I have 2 ranges of numbers, let's say they are stored in area 1 : cells A1 to C6 (18 numbers) and in area 2 : cells D9 to E11 (6 numbers). Is there an easy way to add every combination of an element from area 1 with an element from area 2 and store the result in a third area. So A1 + D9, A1 + D10, A1 + D11, etc So in total 18*6 numbers. The size of the resulting area can be 16x18 or 9x12.

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Adding/multiplying all combinations of numbers from 2 areas

    Quote Originally Posted by MarcoPonte View Post
    I have 2 ranges of numbers, let's say they are stored in area 1 : cells A1 to C6 (18 numbers) and in area 2 : cells D9 to E11 (6 numbers). Is there an easy way to add every combination of an element from area 1 with an element from area 2 and store the result in a third area. So A1 + D9, A1 + D10, A1 + D11, etc So in total 18*6 numbers. The size of the resulting area can be 16x18 or 9x12.
    Hi and welcome to the forum!

    Can you clarify what you mean by the "size of the resulting area" being either 16x18 or 9x12? Your example results in 18x6 i.e. 108 permutations. How does this value relate to 16x18?

    Also, does the order in which results are returned matter? If it does, what should that order be?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    02-11-2015
    Location
    Belgium
    MS-Off Ver
    office 2007
    Posts
    3

    Re: Adding/multiplying all combinations of numbers from 2 areas

    Oeps, a typo ... it should have been 6x 18 ;-)
    In the example the result yields 18*6 = 108 numbers. But there is no preference how this is stored in the worksheet

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Adding/multiplying all combinations of numbers from 2 areas

    Does this spreadsheet help at all (I only finished it last week)?

    in B2:B19 enter your first LIST of numbers
    in C2:C7 enter the second list of numbers
    in D1:G1 enter 1 for all the cells

    You should now find in columns K and L are the combinations from columns B and C
    Just enter a formula in column Q
    =K1 + L1
    and copy down to produce the various results.

    You'll have to rearrange parts of column Q to get the output format you want but the main point of the spreadsheet is to generate combinations.
    Attached Files Attached Files
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Adding/multiplying all combinations of numbers from 2 areas

    This will place the 108 permutations of sums from the entries in A1:C6 and D9:E11 into an 18-row-by-6-column matrix:

    =SUM(INDEX($A$1:$C$6,1+INT((ROWS($1:1)-1)/COLUMNS($A$1:$C$6)),1+MOD((ROWS($1:1)-1),COLUMNS($A$1:$C$6))),INDEX($D$9:$E$11,1+INT(COLUMNS($A:A)-1)/COLUMNS($D$9:$E$11),1+MOD(COLUMNS($A:A)-1,COLUMNS($D$9:$E$11))))

    in your first cell of choice and then copied to the right and down appropriately.

    Regards

  6. #6
    Registered User
    Join Date
    02-11-2015
    Location
    Belgium
    MS-Off Ver
    office 2007
    Posts
    3

    Re: Adding/multiplying all combinations of numbers from 2 areas

    Thanks for the suggestions. I applied them succesfully. Many thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Multiplying and adding a sequence
    By Bananas212 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 03-30-2014, 02:36 PM
  2. [SOLVED] All possible combinations when adding 2 numbers
    By fplated in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-16-2014, 09:02 PM
  3. Adding Numbers the multiplying
    By Soltisolti in forum Excel General
    Replies: 3
    Last Post: 08-24-2010, 01:56 AM
  4. Adding and Multiplying Question
    By John Bordieri in forum Excel General
    Replies: 1
    Last Post: 05-25-2005, 08:11 PM
  5. Adding and Multiplying between worksheets
    By BJH in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 01-24-2005, 11:56 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1