+ Reply to Thread
Results 1 to 4 of 4

help: 4-number permutations

  1. #1
    Ng Tian Khean
    Guest

    help: 4-number permutations

    Can somebody please help me? For a given 4-digit number, I would like to
    create a column listing all the possible permutations of it. For example, if
    the number is '1102' I would like a column showing 1102, 1012, 1021
    ..........N. (The formula/function Permut only tells ne how many permutations
    of it, not list all the numbers. Please tell me clearly step by step how to
    do it. It is for a class project.
    Thank you.



  2. #2
    Max
    Guest

    Re: 4-number permutations

    Here's 2 links to try:

    a. Link posted by Biff previously which leads
    to Myrna's post and power routine: http://tinyurl.com/6okbp

    b. Try Jim Cone's add-in "Display Word Combinations"
    which can handle alpha and numerics
    It is available (for free) upon direct request to Jim ..
    For details, see Jim's post at: http://tinyurl.com/6wz3c
    --
    Rgds
    Max
    xl 97
    ---
    GMT+8, 1° 22' N 103° 45' E
    xdemechanik <at>yahoo<dot>com
    ----
    "Ng Tian Khean" <[email protected]> wrote in message
    news:[email protected]...
    > Can somebody please help me? For a given 4-digit number, I would like to
    > create a column listing all the possible permutations of it. For example,

    if
    > the number is '1102' I would like a column showing 1102, 1012, 1021
    > .........N. (The formula/function Permut only tells ne how many

    permutations
    > of it, not list all the numbers. Please tell me clearly step by step how

    to
    > do it. It is for a class project.
    > Thank you




  3. #3
    Herbert Seidenberg
    Guest

    Re: help: 4-number permutations

    Here is a VBA solution. The spreadsheet solution is harder.
    Sub perm4()
    Dim i As Integer
    Dim j As Integer
    Dim k As Integer
    Dim m As Integer
    Dim p As Integer
    Dim NN As Integer
    Range("A:A").ClearContents
    NN = 4 - 1
    p = 1
    For i = 0 To NN
    For j = 0 To NN
    For k = 0 To NN
    For m = 0 To NN
    If Not (i = j Or i = k Or i = m Or j = k Or j = m _
    Or k = m) Then
    Range("A:A").Cells(p, 1) = i * 1000 + j * 100 + _
    k * 10 + m
    p = p + 1
    End If
    Next m
    Next k
    Next j
    Next i
    End Sub

    Format column A > Custom > 0000


  4. #4
    Registered User
    Join Date
    02-03-2016
    Location
    PA
    MS-Off Ver
    office 2016
    Posts
    1

    Re: help: 4-number permutations

    Hello,
    I am looking for Jim's solution:
    b. Try Jim Cone's add-in "Display Word Combinations"
    which can handle alpha and numerics
    It is available (for free) upon direct request to Jim ..
    For details, see Jim's post at: http://tinyurl.com/6wz3c

    However the link is old and the email address is no longer valid. I have looked all over the web for a spreadsheet solution that would work and can not find one. I have tried Myrna's a few times and that does not seem to work. Any help would be great in coming up with a solution in Excel that can take input of 3 and 4 digit numbers and then break it out into all possible permutations of each number into a sepertate list. That separate list is then pulled into a pivot table which is used for additional calculations.
    The issue I find is that any solution on the net is for a single instance of a number. I need the permutations for many/multiple numbers displayed and listed into a table that is then pulled out via a pivot table.
    Thanks
    Sean

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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