+ Reply to Thread
Results 1 to 14 of 14

Three-letter combination into 1 to 10 characters

  1. #1
    Registered User
    Join Date
    09-20-2020
    Location
    Zamboanga City, Philippines
    MS-Off Ver
    MS Office 16
    Posts
    6

    Unhappy Three-letter combination into 1 to 10 characters

    Please forgive me for this amateur question in advance.

    I have 3 letters, A, B & C. I want to find out how many combinations can I make from 1 to 10 characters using these 3 letters.

    Say: AAAAAAAAAA, AAAAAAAAAB, AAAAAAAAAC etc.

    Where AAAAAAAAAC = AAAACAAAAA = ACAAAAAAAA. (This set is equally the same because of the occurence of a single C)

    or say AAAB = ABAA = BAAA

    or say BBBC = BCBB = CBBB

    or say AB = BA, CB = BC, or AC = CA

    or say AAB = ABA = BAA or CBB = BCB = BBC

    From 1 to 10 characters.

    How do I populate my rows with these combinations?

    I hope this is clear.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,888

    Re: Three-letter combination into 1 to 10 characters

    Crosspost: https://chandoo.org/forum/threads/th...racters.45047/

    Rule 03: Cross-posting Without Telling Us

    Your post does not comply with Rule 3 of our Forum RULES. Do not cross-post your question on multiple forums without telling us about your threads on other forums.

    Post a link to any other forums where you have asked the same question.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Read this to understand why we ask you to do this.

    I have added the crosspost reference for you today. Please comply with this and all our rules in the future
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Three-letter combination into 1 to 10 characters

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mehmetcik; 09-21-2020 at 09:39 AM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Three-letter combination into 1 to 10 characters

    Open Power Query/Get and Transform. Click on New Query.
    Open blank query in the editor, launch Advanced Editor and paste in the following code.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Bo_Ry; 09-21-2020 at 12:22 PM. Reason: Update file

  5. #5
    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: Three-letter combination into 1 to 10 characters

    If you just want the count of unordered samples with replacement ("n multichoose k"), it's

    =COMBIN(n + k - 1, k)

    E.g., for 10-character strings of three symbols,

    =COMBIN(10 + 3 - 1, 3) = 220
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Registered User
    Join Date
    09-20-2020
    Location
    Zamboanga City, Philippines
    MS-Off Ver
    MS Office 16
    Posts
    6

    Re: Three-letter combination into 1 to 10 characters

    Very very sorry, did not know that cross-posting is a thing. This is my first time to post in online asking for excel help. Even my first time to hear cross-posting. Forgive my ignorance.

  7. #7
    Registered User
    Join Date
    09-20-2020
    Location
    Zamboanga City, Philippines
    MS-Off Ver
    MS Office 16
    Posts
    6

    Re: Three-letter combination into 1 to 10 characters

    Thank you both for your help. I did not know that this is even possible. You guys are genuises at mehmetcik & Bo_Ry.

    One last thing, is there any way I can increase/decrease the maximum number of characters I need?

    And how do I sort this such that it will appear as alphabetically and also from the least number of characters to the highest?

    Say in a 1 to 3 characters of ABC it will be:

    A
    AA
    AAA
    B
    BA
    BAA
    BB
    BBA
    BBB
    C
    CA
    CAA
    CB
    CBB
    CC
    CCA
    CCB
    CCC

    Thank you so much again for the help.
    Last edited by Abu Haydar; 09-21-2020 at 01:26 PM.

  8. #8
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Three-letter combination into 1 to 10 characters

    Hi.

    Now that my Formula is created it is very simple.

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 09-21-2020 at 01:24 PM.

  9. #9
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Three-letter combination into 1 to 10 characters

    Add Character list at Column C, change maximum number in E2 , then right click and refresh


    Please Login or Register  to view this content.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    09-20-2020
    Location
    Zamboanga City, Philippines
    MS-Off Ver
    MS Office 16
    Posts
    6

    Re: Three-letter combination into 1 to 10 characters

    Thank you for finding time to even explain each formula in the Macro. Very helpful. Is there a way I can sort out the list as mentioned in the example above? I'd be happy even just to sort it out with that criteria without Macro.

    "And how do I sort this such that it will appear as alphabetically and also from the least number of characters to the highest?

    Say in a 1 to 3 characters of ABC it will be:

    A
    AA
    AAA
    B
    BA
    BAA
    BB
    BBA
    BBB
    C
    CA
    CAA
    CB
    CBB
    CC
    CCA
    CCB
    CCC"

  11. #11
    Registered User
    Join Date
    09-20-2020
    Location
    Zamboanga City, Philippines
    MS-Off Ver
    MS Office 16
    Posts
    6

    Re: Three-letter combination into 1 to 10 characters

    Somehow when E2 = 10 and C column is ABC this gives 294 combinations unlike the previous 285 in combinABC.xlsx??

  12. #12
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Three-letter combination into 1 to 10 characters

    Try this revised code

    Please Login or Register  to view this content.

  13. #13
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Three-letter combination into 1 to 10 characters

    Quote Originally Posted by Abu Haydar View Post
    Somehow when E2 = 10 and C column is ABC this gives 294 combinations unlike the previous 285 in combinABC.xlsx??
    I still see 285

    Com.png

    Add List.Sort

    Please Login or Register  to view this content.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    09-20-2020
    Location
    Zamboanga City, Philippines
    MS-Off Ver
    MS Office 16
    Posts
    6

    Re: Three-letter combination into 1 to 10 characters

    Thank you so much guys for your time and efforts. But asking for more will be too much already. This thread ends right here for me. THANK YOU.

+ 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. eliminate a certain combination of letter and number
    By Pheenix324 in forum Excel General
    Replies: 4
    Last Post: 06-08-2020, 08:49 PM
  2. Replies: 9
    Last Post: 05-15-2019, 10:55 AM
  3. [SOLVED] Subracting numbers with a letter combination
    By Poppyhead66 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 06-15-2015, 02:48 AM
  4. Combination of letter and numbers in a column
    By aminkov1991 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-14-2015, 04:04 PM
  5. Format issue with changing a number letter combination to a date
    By Newbiedine in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-13-2014, 01:34 AM
  6. combination of letter to form new string
    By mqcai4613 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2014, 10:11 AM
  7. Need Validation formula for a Letter Number Combination
    By Talo in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 11-19-2012, 12:22 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