+ Reply to Thread
Results 1 to 6 of 6

Combinations of 4 Ranks

  1. #1
    Registered User
    Join Date
    04-04-2015
    Location
    Vancouver, Canada
    MS-Off Ver
    Office 365
    Posts
    88

    Combinations of 4 Ranks

    Hi,
    I'm trying to figure this out...
    I have 4 columns. Cells in these columns can have 4 ranks: s, h, c, d.
    These ranks are put in every possible order. 256 (4*4*4*4).
    I would like to "organize" these rows.
    For example, ssss is same as hhhh which is same as cccc as well as dddd.
    Another example, shcd is same as hcds, and cdsh.. etc.

    I thought about how to do this and the best solution I could come up with is:
    Make all ranks in column A to equal A.
    If that rank is repeated later on (For example, ssss) then set it to A again. So in the ssss example, it will be AAAA.
    Column B will be equal to B unless the rank is same as column A.
    Same idea for column C and D.

    Few examples:
    sshd - AABC
    sssc - AAAB
    shdh - ABCB
    shhh - ABBB
    dshh - ABCC

    After I do this I can sort through these new "ranks" and only have non-recurring ranks.
    I need to do this in VBA, because I need to use these new ranks to sort..
    I tried to do this using Select Case. But it became huge quick and I could not keep track of what was going on...

    ranks.xlsx

    Can you help me please?

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

    Re: Combinations of 4 Ranks

    Row\Col
    A
    B
    C
    1
    sshd AABC B1: =sWdPatt(A1)
    2
    sssc AAAB
    3
    shdh ABCB
    4
    shhh ABBB
    5
    dshh ABCC


    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    04-04-2015
    Location
    Vancouver, Canada
    MS-Off Ver
    Office 365
    Posts
    88

    Re: Combinations of 4 Ranks

    I don't know what this function is doing exactly now but I will take a look at it.
    Thank you for your help

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

    Re: Combinations of 4 Ranks

    You're welcome.

    In your example file, you could use

    =sWdPatt(A2 & B2 & C2 & D2)

  5. #5
    Registered User
    Join Date
    04-04-2015
    Location
    Vancouver, Canada
    MS-Off Ver
    Office 365
    Posts
    88

    Re: Combinations of 4 Ranks

    It works perfectly. You are a god!!

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

    Re: Combinations of 4 Ranks

    Lesser god. You're welcome.

+ 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 possible combinations & listing the wanted combinations
    By Zoke in forum Excel Programming / VBA / Macros
    Replies: 30
    Last Post: 07-16-2012, 03:41 PM
  2. Sum of ranks
    By Tim Otero in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 09-06-2005, 06:05 AM
  3. Sum of ranks
    By Tim Otero in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 01:05 AM
  4. Sum of ranks
    By Tim Otero in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 09-05-2005, 11:05 PM
  5. Sum of ranks
    By Tim Otero in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 09-05-2005, 10:05 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