+ Reply to Thread
Results 1 to 5 of 5

Create all possible combinations for three numbers

  1. #1
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Create all possible combinations for three numbers

    Hello everyone
    I need to create all possible combinations for those three numbers 1 , 2 and 3 ... in 6 rows
    I have put some of expected output in the attachment

    Thanks advanced for help
    Attached Files Attached Files
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,211

    Re: Create all possible combinations for three numbers

    with formulas copy the following accross 729 (3^6) columns
    row 1 =TRUNC((COLUMN(A1)-1)/3^5)+1
    row2 =MOD(TRUNC((COLUMN(A2)-1)/3^4),3)+1
    row3 =MOD(TRUNC((COLUMN(A3)-1)/3^3),3)+1
    row4 =MOD(TRUNC((COLUMN(A4)-1)/3^2),3)+1
    row5 = MOD(TRUNC((COLUMN(A5)-1)/3),3)+1
    row6==MOD(COLUMN(A1)-1,3)+1

  3. #3
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Create all possible combinations for three numbers

    Thanks a lot for your great solution
    I need a VBA code for that .. as I need to store results in an VBA array first
    Best Regards

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,211

    Re: Create all possible combinations for three numbers

    You have not said how you want the information held in an array and what you wish to do with it. It makes hard to know what you want as an answer. To create the values with Vba is easy as its just 6 nested loops

    Please Login or Register  to view this content.
    I will let you add the array bit where you see fit

  5. #5
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Create all possible combinations for three numbers

    Thank you very much Mr. Davsth
    You are great and thanks for your time
    Regards

+ 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. please help!!ALL COMBINATIONS REQUIRED FOR 5-DIGIT NUMBERs using numbers 0-9
    By natasha mirembe in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2014, 01:43 PM
  2. [SOLVED] Macro to create combinations
    By CarlosLopez in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-04-2013, 02:31 AM
  3. Create combinations in same row each one
    By pshls in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-21-2013, 08:38 AM
  4. How to create formula to display different combinations of numbers
    By itsme74 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-01-2012, 03:32 AM
  5. Create Combinations and permutations from 27 numbers
    By theborg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-18-2012, 02:28 AM
  6. Replies: 1
    Last Post: 04-15-2012, 09:23 AM
  7. [SOLVED] Macro to add numbers to create combinations that equal certain amo
    By Lauren qt314 in forum Excel General
    Replies: 3
    Last Post: 04-21-2005, 01:06 PM

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