+ Reply to Thread
Results 1 to 13 of 13

Sort on whether cell contains 2 consecutive capital letters

  1. #1
    Forum Contributor
    Join Date
    06-09-2009
    Location
    Greece
    MS-Off Ver
    Office 365
    Posts
    133

    Sort on whether cell contains 2 consecutive capital letters

    For example:

    FTjklkjs
    fdZS fjkjjd
    sdajkl JSsdf
    afdjk Fj
    Ajkj Ajkljk

    Also, a variation, whether a cell contains all caps, i.e.

    RTY
    GSKLK
    JSI JFKD
    ZFIOS

    AEs jfkjkj
    gfklk Sklkf
    Egdkl Sstskl

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Sort on whether cell contains 2 consecutive capital letters

    Question 1.
    Assumes: column A is empty, data are in column B, C1 contains the digit 1
    D1contains this equation (copied down)
    Formula: copy to clipboard
    Please Login or Register  to view this content.


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


    Question 2.

    In H1, copied down
    Formula: copy to clipboard
    Please Login or Register  to view this content.


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

    sEE THE ATTACHMENT, TOO.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    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: Sort on whether cell contains 2 consecutive capital letters

    A one-line UDF would make it pretty simple:

    A
    B
    C
    1
    FTjklkjs
    TRUE
    B1: =LikeThis(A1, "*[A-Z][A-Z]*")
    2
    fdZS fjkjjd
    TRUE
    3
    sdajkl JSsdf
    TRUE
    4
    afdjk Fj
    FALSE
    5
    Ajkj Ajkljk
    FALSE
    6
    7
    RTY
    TRUE
    B7: =NOT(LikeThis(A7, "*[a-z]*"))
    8
    GSKLK
    TRUE
    9
    JSI JFKD
    TRUE
    10
    ZFIOS
    TRUE
    11
    AEs jfkjkj
    FALSE
    12
    gfklk Sklkf
    FALSE
    13
    Egdkl Sstskl
    FALSE


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

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Sort on whether cell contains 2 consecutive capital letters

    My solution is many things... but it's neither pretty, nor simple

  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: Sort on whether cell contains 2 consecutive capital letters

    Messy to do via formula.

  6. #6
    Forum Contributor
    Join Date
    06-09-2009
    Location
    Greece
    MS-Off Ver
    Office 365
    Posts
    133

    Re: Sort on whether cell contains 2 consecutive capital letters

    shg, for some reason, both functions give me #NAME?

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Sort on whether cell contains 2 consecutive capital letters

    Did you look at the (messy) formula that I used, which does appear to work OK?

  8. #8
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Sort on whether cell contains 2 consecutive capital letters

    Sorry my bad! Did not properly read the OP's request

    Alf
    Last edited by Alf; 06-15-2014 at 06:41 AM. Reason: Did not read OP's request

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Sort on whether cell contains 2 consecutive capital letters

    Quote Originally Posted by Alf View Post
    Sorry my bad! Did not properly read the OP's request

    Alf
    Woo Hoo! I thought I was the only one who did this sort of thing ...

  10. #10
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Sort on whether cell contains 2 consecutive capital letters

    Did you open the VBA editor (Alt F11) and insert a module then copy and paste the function code as written into the module?

    The next thing for it to work was to enter the formula EXACTLY as SHG wrote it

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


    I tried it and it works just fine.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  11. #11
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Sort on whether cell contains 2 consecutive capital letters

    it to work was to enter the formula EXACTLY as SHG wrote it
    That will depend on the delimiter used in Greece i.e. probably ";" instead of ","

    I thought I was the only one who did this sort of thing ...
    Oh no I guess there are quite a number of us who do so

    Alf

  12. #12
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Sort on whether cell contains 2 consecutive capital letters

    best i can come up with apart from a udf is this array entered formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  13. #13
    Forum Contributor
    Join Date
    06-09-2009
    Location
    Greece
    MS-Off Ver
    Office 365
    Posts
    133

    Re: Sort on whether cell contains 2 consecutive capital letters

    Quote Originally Posted by newdoverman View Post
    Did you open the VBA editor (Alt F11) and insert a module then copy and paste the function code as written into the module?
    Yes, I had missed that part, 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. Sort capital letters before lower case?
    By Tinwelende in forum Excel General
    Replies: 42
    Last Post: 06-17-2013, 03:58 PM
  2. Replies: 4
    Last Post: 07-25-2012, 11:40 PM
  3. Replies: 13
    Last Post: 07-08-2012, 11:26 PM
  4. Text to Coloumns, by consecutive capital letters
    By paperclip in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-20-2006, 07:38 AM

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