+ Reply to Thread
Results 1 to 4 of 4

numbers combination help needed

  1. #1
    Registered User
    Join Date
    05-26-2009
    Location
    Nebraska
    MS-Off Ver
    Excel 2003
    Posts
    6

    Smile numbers combination help needed

    Hello, I need help with finding all the combinations using the number 1 through 8 and ending up with 5 numbers across for each combination.

    I have now:
    A BC D E
    1 1 1 1 1


    I need:
    A BC DE
    1 1 1 1 1
    1 1 1 1 2
    1 1 1 1 3
    1 1 1 1 4
    1 1 1 1 5
    1 1 1 1 6
    1 1 1 1 7
    1 1 1 1 8 etc. etc.

    For example, after this is finished I wish to find for instance the number 82753.
    I would scroll down and it would look like this:
    .........A B C D E
    (row?) 8 2 7 5 3

    I appreciate and advice anyone may have!
    notobo
    Last edited by notobo; 05-26-2009 at 09:08 PM.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: numbers combination help needed

    Hi notobo, and welcome to the forum. I think these five formulas will work for you:

    In A1, B1, C1, D1 and E1 just put the number 1.

    In A2 put the formula: =IF(AND(A1=8,B1=8,C1=8,D1=8,E1=8),"",IF(AND(B1=8,C1=8,D1=8,E1=8),A1+1,A1))
    In B2 put the formula: =IF(AND(B1=8,C1=8,D1=8,E1=8),1,IF(AND(C1=8,D1=8,E1=8),B1+1,B1))
    In C2 put the formula: =IF(AND(C1=8,D1=8,E1=8),1,IF(AND(D1=8,E1=8),C1+1,C1))
    In D2 put the formula: =IF(AND(D1=8,E1=8),1,IF(E1=8,D1+1,D1))
    In E2 put the formula: =IF(E1=8,1,E1+1)

    Select A2:E2 and fill those formulas down to row 32768 (which is, if I've done it correctly) the number of results.

    Hopefully I'm right, and hopefully it helps!

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: numbers combination help needed

    Great stuff Paul...

    To finish off the OPs query, add this in F1 and copy it down the whole dataset, too:

    =(A1&B1&C1&D1&E1)+0

    Then type any number in J1, and this formula in J2 will give you the row number:

    =MATCH(J1,F:F,0)
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: numbers combination help needed

    I have not look at pjoaquin's solution, so if that suits, use it by all means. In the attachment. drag the formulas down as necessary.
    Attached Files Attached Files
    Entia non sunt multiplicanda sine necessitate

+ 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