+ Reply to Thread
Results 1 to 6 of 6

How to select one row from each group of columns under a condition

  1. #1
    Registered User
    Join Date
    01-06-2013
    Location
    New York, EUA
    MS-Off Ver
    Excel 2013
    Posts
    77

    How to select one row from each group of columns under a condition

    Hi all,

    I need to select one row from each one of 15 groups of columns, under the condition that the resulting matrix (15 rows x 6 columns) has no columns with duplicates.

    The attached file shows a few results (columns "DF" to "DK"). The only problem is that it takes too long to run.

    So, I would like to ask your help to create a faster macro. I only need that each column of the resulting matrix has no duplicates.

    Thanks.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: How to select one row from each group of columns under a condition

    JOAO12,

    Can you just clarify the process please?

    Starting with A2 - F2, assume you find fourteen sets from the other ranges that have no columns duplicating A2 - F2.
    Do you then repeat the cycle but excluding the rows you selected in the fourteen other ranges, so you now have A2 - F2 and the SECOND unduplicated row from Cols H - M, etc,?
    And when you have exhausted all the combinations against A2 - F2, do you then want to repeat the process using A3 - F3?
    And when you have exhausted Cols A - F, do you want to repeat the steps based on the first row of H - M, which now looks at Cols A - F, Cols O - T and so on?

    Ochimus
    Last edited by Ochimus; 01-01-2021 at 11:27 PM.

  3. #3
    Registered User
    Join Date
    01-06-2013
    Location
    New York, EUA
    MS-Off Ver
    Excel 2013
    Posts
    77

    Re: How to select one row from each group of columns under a condition

    Hi, Ochimus, let me explain better.

    There are 15 groups with 6 columns each: "A-F", "H-M", "O-T", "V-AA", "AC-AH", "AJ-AO", "AQ-AV", "AX-BC", "BE-BJ", "BL-BQ", "BS-BX", "BZ-CE", "CG-CL", "CN-CS" and "CU-CZ".

    I need a macro to select one row from each range, so that the values selected from columns “A”, “H”, “O”, “V”, “AC”, “AJ”, “AQ”, “AX”, “BE”, “BL”, “BS”, “BZ”, “CG”, “CN” and “CU” are different from each other (no duplicates).

    The values selected from columns “B”, “I”, “P”, “W”, “AD”, “AK”, “AR”, “AY”, “BF”, “BM”, “BT”, “CA”, “CH”, “CO” and “CV” are different from each other (no duplicates).

    The values selected from columns “C”, “J”, “Q”, “X”, “AE”, “AL”, “AS”, “AZ”, “BG”, “BN”, “BU”, “CB”, “CI”, “CP” and “CW” are different from each other (no duplicates).

    The values selected from columns “D”, “K”, “R”, “Y”, “AF”, “AM”, “AT”, “BA”, “BH”, “BO”, “BV”, “CC”, “CJ”, “CQ” and “CX” are different from each other (no duplicates).

    The values selected from columns “E”, “L”, “S”, “Z”, “AG”, “AN”, “AU”, “BB”, “BI”, “BP”, “BW”, “CD”, “CK”, “CR” and “CY” are different from each other (no duplicates).

    The values selected from columns “F”, “M”, “T”, “AA”, “AH”, “AO”, “AV”, “BC”, “BJ”, “BQ”, “BX”, “CE”, “CL”, “CS” and “CZ” are different from each other (no duplicates).

    Please see the colored cells in the attached file (Test 2.xlsm).

    Please let me know if you need any further information.

    Thanks.
    Attached Files Attached Files
    Last edited by JOAO12; 01-02-2021 at 08:34 AM.

  4. #4
    Registered User
    Join Date
    01-01-2021
    Location
    Russia
    MS-Off Ver
    Onenyryt
    Posts
    1

    -

    Its a fixed texture size of 128128 multiple light maps are stored in one file but the uvmapping is weird, a single lightmap can have polygons from all over the level allocated to it

  5. #5
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: How to select one row from each group of columns under a condition

    JOAO12,

    Appreciate the response, but it's still not clear?

    You said you wanted one fifteen row "bloc" where none of the columns have duplicated numbers.

    But your Sample has six separate copies of the same "solution" sequence in Cols DF - DK, which is not what you asked for originally?

    I'm also unclear why you used row 3 in Cols H - M, when row 2 has no "duplicates" of A2 - F2?

    In fact there are thirty one rows in Col H - M where no number in the "matching" column is the same as those in A2 - F2.

    Hence my question of whether you wanted the process to present ALL the possible fifteen-row combinations from the blocs across H - CZ that have no matches in the relevant columns in A2 - F2 or the other fourteen ranges as you work across?.

    Ochimus
    Last edited by Ochimus; 01-02-2021 at 11:03 PM.

  6. #6
    Registered User
    Join Date
    01-06-2013
    Location
    New York, EUA
    MS-Off Ver
    Excel 2013
    Posts
    77

    Re: How to select one row from each group of columns under a condition

    Hi, Ochimus,

    About columns “H-M”: although some rows could be used, if the group does not have 15 rows, then the group is not full and the condition is not filled (as each combination should have 15 rows).

    In fact, I need the process to present all the possible fifteen-row combinations from the blocs across “H-CZ” that have no matches in the relevant columns, starting with “A2-F2” and repeating the cycle up to “A30-F30”. The selected rows should not be excluded, because they may be used in different combinations (as shown in the six groups in columns “DF-DK”, that are not completely equal to each other, as a few rows are different).

    The six groups of fifteen rows have a few cells with different values. For example: “DK7” (8) vs “DK24” (15), “DK9” (21) vs “DK26” (8) and “DK15” (15) vs “DK32” (21).

    Columns "DF-DK" show only 6 combinations, but there are many more possible combinations.

    I am sorry if I did not express myself clearly.

    Thanks.
    Last edited by JOAO12; 01-03-2021 at 12:08 AM.

+ 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. [SOLVED] Take min value from Group B if Group A condition met
    By benexclaimed in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-27-2019, 05:04 PM
  2. Replies: 11
    Last Post: 11-03-2017, 05:11 AM
  3. Replies: 14
    Last Post: 01-12-2017, 01:41 PM
  4. Replies: 7
    Last Post: 06-09-2016, 09:48 PM
  5. [SOLVED] Select group and return certain columns
    By rs1aj in forum Excel General
    Replies: 13
    Last Post: 04-05-2016, 09:45 AM
  6. Replies: 1
    Last Post: 02-03-2016, 06:43 PM
  7. Replies: 2
    Last Post: 01-18-2013, 12:45 PM

Tags for this Thread

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