+ Reply to Thread
Results 1 to 27 of 27

Get a list of words consisting of certain letters only, from a named range

  1. #1
    Forum Contributor
    Join Date
    08-30-2015
    Location
    Tresfjord, Norway
    MS-Off Ver
    365
    Posts
    169

    Get a list of words consisting of certain letters only, from a named range

    Hi ...
    i have tried for days to extract certain words from a named range. These words should consist of certain letters only.

    Lets say the named range "words" consist of these words in A1:A12:
    akp
    akper
    akpere
    akps
    anc
    ancs
    ansa
    ansi
    acnac
    aofs
    ap
    can

    Lets also say that the letters to search for is in B1:B3 like this:
    a
    n
    c

    The search should result in a list of words in the C-column, consisting of these 3 letters only.
    Like this:
    anc
    can
    acnac

    I have tried using FILTER, TRIM, MID, MAX, REPT, SUSTITUTE and much, much more, but they all yielded no desiered results.

    How can I accomplish this?

    A VBA solution may be?

    in advance thank you!
    Really would appreciate a solution to this, since I'm utterly stucked.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,906

    Re: Get a list of words consisting of certain letters only, from a named range

    Still using Excel 2016?

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: HOW TO ATTACH YOUR SAMPLE WORKBOOK). Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    08-30-2015
    Location
    Tresfjord, Norway
    MS-Off Ver
    365
    Posts
    169

    Re: Get a list of words consisting of certain letters only, from a named range

    Sorry about that!
    Here it is ...
    Attached Files Attached Files

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,906

    Re: Get a list of words consisting of certain letters only, from a named range

    And your Excel version?

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,457

    Re: Get a list of words consisting of certain letters only, from a named range

    With 365 or 2021:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  6. #6
    Forum Contributor
    Join Date
    08-30-2015
    Location
    Tresfjord, Norway
    MS-Off Ver
    365
    Posts
    169

    Re: Get a list of words consisting of certain letters only, from a named range

    Updated 365

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,457

    Re: Get a list of words consisting of certain letters only, from a named range

    With your example

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,457

    Re: Get a list of words consisting of certain letters only, from a named range

    Please update your profile.

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,906

    Re: Get a list of words consisting of certain letters only, from a named range

    Nice idea, Trevor!

    This seems to work:

    =LET(a,A1:A12,s,SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(a,B1,""),B2,""),B3,""),FILTER(a,s=""))

    Updated 365
    Please update your profile.

  10. #10
    Forum Contributor
    Join Date
    08-30-2015
    Location
    Tresfjord, Norway
    MS-Off Ver
    365
    Posts
    169

    Re: Get a list of words consisting of certain letters only, from a named range

    sorry, but BYROW didn't translate to norwegian version

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,906

    Re: Get a list of words consisting of certain letters only, from a named range

    PLEASE UPDATE YOUR PROFILE!!!

    Don't ignore instructions, please.

    As far as I can tell, BYROW is BYROW in Norwegian:

    =LET(a;A1:A12;FILTRER(a;BYROW(a;LAMBDA(r;BYTT.UT(BYTT.UT(BYTT.UT(r;$B$1;"");$B$2;"");$B$3;"")))=""))

    https://support.microsoft.com/nb-no/...0-a4602f2602bb

    And what about post #9?

    =LET(a;A1:A12;s;BYTT.UT(BYTT.UT(BYTT.UT(a;B1;"");B2;"");B3;"");FILTRER(a;s=""))
    Last edited by AliGW; 08-25-2023 at 05:50 AM.

  12. #12
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,433

    Re: Get a list of words consisting of certain letters only, from a named range

    This Excel 365 formula does also the job:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    For translation of the formula in your own language, see attached workbook.
    Attached Files Attached Files
    Last edited by HansDouwe; 08-25-2023 at 06:12 AM.

  13. #13
    Forum Contributor
    Join Date
    08-30-2015
    Location
    Tresfjord, Norway
    MS-Off Ver
    365
    Posts
    169

    Re: Get a list of words consisting of certain letters only, from a named range

    I can't get you solutions to work
    What am I doing wrong?
    Attached Files Attached Files

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,906

    Re: Get a list of words consisting of certain letters only, from a named range

    Please update your forum profile - I have asked many times already and it still says Excel 2016 ...

    Thank you.

    There are NO results to return for a, n and k - what were you expecting?

    This will work for a, n and c:

    =LET(a,VSTACK(A1:A12,B1:B12),s,SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(a,C1,""),C2,""),C3,""),FILTER(a,s=""))
    Attached Files Attached Files
    Last edited by AliGW; 08-25-2023 at 09:11 AM. Reason: Workbook added.

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,906

    Re: Get a list of words consisting of certain letters only, from a named range

    An error trap will show when there are no results:

    =IFERROR(LET(a,VSTACK(A1:A12,B1:B12),s,SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(a,C1,""),C2,""),C3,""),FILTER(a,s="")),"No Results")

  16. #16
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,433

    Re: Get a list of words consisting of certain letters only, from a named range

    I assume you are using Excel 365, because you posted in post #6: "Update 365"
    Is that right?
    You can check yout current version in Excel: Click on your account name (at the top) and click "office user info".

    Does the formula work in the sheet I uploaded in Post #12?
    And does it still work after you changed something in the input?
    Is so, please try that formula.

  17. #17
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,433

    Re: Get a list of words consisting of certain letters only, from a named range

    O I see, you have structured your sheet in another way, the words are now in 2 different columns:

    Please try
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  18. #18
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,433

    Re: Get a list of words consisting of certain letters only, from a named range

    A little bit neater, please try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  19. #19
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,386

    Re: Get a list of words consisting of certain letters only, from a named range

    I have one more item as output

    Please Login or Register  to view this content.

  20. #20
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,433

    Re: Generating an if statement to gather an average

    @Jec, your formula returns in this example also ancs.

    ancs is not correct, because the OP asks: "These words should consist of certain letters only."

    The certain letters are a, n & c, but acns contains also a s.
    Attached Files Attached Files
    Last edited by HansDouwe; 08-25-2023 at 10:12 AM.

  21. #21
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,906

    Re: Get a list of words consisting of certain letters only, from a named range

    @Hans - you'd posted in the wrong thread. I've moved your post here.

  22. #22
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,386

    Re: Get a list of words consisting of certain letters only, from a named range

    Ahh yes, correct. I did not read the first post. Good stuff

  23. #23
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,386

    Re: Get a list of words consisting of certain letters only, from a named range

    Another try

    Please Login or Register  to view this content.

  24. #24
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,906

    Re: Get a list of words consisting of certain letters only, from a named range

    @Tresfjording

    Where are we with this? Have you managed to get anybody's suggestions working? Some feedback would be nice.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

  25. #25
    Forum Contributor
    Join Date
    08-30-2015
    Location
    Tresfjord, Norway
    MS-Off Ver
    365
    Posts
    169

    Re: Get a list of words consisting of certain letters only, from a named range

    The solution in post 9 did the trick.
    Thank you ALiGW.
    A well deserved addment to your reputation is given

    And thanks to the rest of you contributng, and making her solution even better.
    Now the suggested formula is searchng 29 worksheets containing more than a million words, for words consisting of only of certain seven letters.

    Have a nice weekend, all of you!!!

  26. #26
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,433

    Re: Get a list of words consisting of certain letters only, from a named range

    The solution in post 9 did the trick.
    Thanks for yout feedback.

    Strange that you choose formula 9. This formula stopped working in Post #13 when it turned out that your input structure was different.
    Subsequently, three members came up with other solutions that fit the new structure.
    Was that for nothing?

    Furthermore, the formulas in item 17 and item 23 are easier to adapt when the number of different characters of which the selected words must consist becomes more or less.

  27. #27
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,906

    Re: Get a list of words consisting of certain letters only, from a named range

    I think he probably meant post #15, where I addressed the change in layout.

    And the OP did say:

    And thanks to the rest of you contributng, and making her solution even better.
    so I don't read this as anyone else's efforts having been for nothing.

    Glad to have helped, anyway.

+ 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. Replies: 2
    Last Post: 05-11-2022, 03:44 AM
  2. Replies: 2
    Last Post: 02-24-2022, 12:07 AM
  3. Macro to a range consisting of any current cell and 12 cells to the right
    By mytguy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-05-2019, 02:19 PM
  4. Create range consisting only of autofilter results.
    By T12ISC in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-10-2014, 10:21 AM
  5. [SOLVED] Macro to to select latest date in cell with validation list consisting of dates.
    By rocksan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-23-2012, 04:41 AM
  6. Need to scramble letters in list of words
    By SusanB in forum Excel General
    Replies: 1
    Last Post: 03-28-2006, 12:45 PM
  7. [SOLVED] A range variable consisting of multiple ranges.
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-04-2005, 05:06 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