+ Reply to Thread
Results 1 to 4 of 4

How to generate all 4 digit combinations out of an 8 number pool and then break down

  1. #1
    Registered User
    Join Date
    09-06-2013
    Location
    nj
    MS-Off Ver
    Excel 2010
    Posts
    1

    How to generate all 4 digit combinations out of an 8 number pool and then break down

    Hi,

    I have played around with COUNTIF, SUM, PERMUT & COMBIN in order to get my own end results and being as I use Excel on a limited basis, I am in no way, shape or form a "formula/figure expert" person.

    What I am looking to do...

    I would like to enter my own (4) digit numbers and insert a formula to give me all possible combinations for those (4) digit numbers. Total numbers to be used would be 8. (1 through 8, each number occurring only 1 time in each line, no duplicates on a line)

    Example: I am trying to get the actual number combinations listed - NOT just the total combinations available

    4-3-2-1......getting me 3-2-1-4, 2-3-4-1, 4-1-2-3, etc...
    8-7-2-4......getting me 7-2-4-8, 2-4-8-7, 7-4-2-8, etc...
    5-2-3-1......getting me 5-1-2-3, 3-2-5-1, 2-5-3-1, etc...

    The next step would to be able to pull out numbers that repeat (either 2 or three times) in each combination (like the 1-2 & 3 in the 1st & 2nd example)

    As my username states - I am looking for the step by step (actual way to put it on spreadsheet) coding, as stated I have VERY Basic experience and this is for my job for parts coding

    THANK YOU SOOOOO MUCH!!!

  2. #2
    Forum Contributor
    Join Date
    08-02-2013
    Location
    Wageningen, The Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    493

    Re: How to generate all 4 digit combinations out of an 8 number pool and then break down

    I don't know of a fully automatic way to do this, but with some work I can give you the solution for the first part of your question

    with 4 digits there are always 4*3*2*1=24 possible sequences. since you will already give 1, there are 23 remaining.
    formulas for isolating the different digits are as follows (assuming the first code is in A1):
    the first digit: =LEFT(A1;1)
    the second digit: =MIDDLE(A1;3;1)
    the third digit: =MIDDLE(A1;5;1)
    the fourth digit: =RIGHT(A1;1)

    now 'just' build all the combinations by typing these formulas with ampersands between them
    so it would begin like this:
    =LEFT(A1;1)&MIDDLE(A1;3;1)&RIGHT(A1;1)&MIDDLE(A1;5;1)
    =LEFT(A1;1)&MIDDLE(A1;5;1)&MIDDLE(A1;3;1)&RIGHT(A1;1)
    etc etc etc etc etc etc...

    sorry I don't know of an easier way
    When I say semicolon, u say comma!

  3. #3
    Registered User
    Join Date
    01-28-2016
    Location
    ireland
    MS-Off Ver
    ms office home/student 2010
    Posts
    13

    Re: How to generate all 4 digit combinations out of an 8 number pool and then break down

    if i have a 5 digit combination 3-8-7-0-1 how do I get excel to show me all posiblities of combination, can some actual show me exactly how to do it, im lost? thanks

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2010 on Linux
    Posts
    12,047

    Re: How to generate all 4 digit combinations out of an 8 number pool and then break down

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

+ 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. Finding Combinations of a Three digit Number
    By darrylx in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 11-08-2011, 05:29 AM
  2. Generate combinations for a variable number of columns in order
    By q83 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-30-2011, 04:17 PM
  3. Replies: 2
    Last Post: 09-23-2010, 11:12 AM
  4. 5 digit number combinations
    By Puppiie in forum Excel - New Users/Basics
    Replies: 14
    Last Post: 09-02-2010, 05:02 PM
  5. How generate different number combinations
    By raigo in forum Excel General
    Replies: 2
    Last Post: 04-13-2010, 04:52 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