+ Reply to Thread
Results 1 to 3 of 3

Separate words into different columns by capital letters

  1. #1
    Registered User
    Join Date
    05-29-2014
    MS-Off Ver
    2016
    Posts
    31

    Separate words into different columns by capital letters

    I want to separate words into different columns once a capital letter is met as in rows 5 and 6.
    But the same function does not work in rows 2 to 4.
    Is there anyway to solve this? Thanks!

    capital.png

    The functions I use in columns C and D are
    cell C2:
    =LEFT(A2,SMALL(FIND(CHAR(ROW(INDIRECT("65:90"))),A2&"ABCDEFGHIJKLMNOPQRSTUVWXYZ"),2)-1)
    cell D2:
    =REPLACE(A2,1,LEN(C2),"")

    Edit:
    I figured out what's wrong.
    The 2 was in the wrong place so the FIND started as 1
    SMALL was missing the second argument (1).
    Last edited by plakatown; 09-19-2022 at 01:58 AM.

  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,067

    Re: Separate words into different columns by capital letters

    You can also use this, which avoids the unnecessary use of the volatile INDIRECT function:

    =IFERROR(MID(A1,MATCH(1,(CODE(MID(A1,ROW($1:$255),1))>=65)*(CODE(MID(A1,ROW($2:$255),1))<90),)+1,255),"")

    It's still an array formula. But this variant might not be in your Excel version:

    =IFERROR(MID(A2,MATCH(1,INDEX((CODE(MID(A2,ROW($1:$255),1))>=65)*(CODE(MID(A2,ROW($2:$255),1))<90),),0)+1,255),"")

    and then just use SUBSTITUTE for the other word.
    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
    Registered User
    Join Date
    05-29-2014
    MS-Off Ver
    2016
    Posts
    31

    Re: Separate words into different columns by capital letters

    Quote Originally Posted by Glenn Kennedy View Post
    You can also use this, which avoids the unnecessary use of the volatile INDIRECT function:

    =IFERROR(MID(A1,MATCH(1,(CODE(MID(A1,ROW($1:$255),1))>=65)*(CODE(MID(A1,ROW($2:$255),1))<90),)+1,255),"")

    It's still an array formula. But this variant might not be in your Excel version:

    =IFERROR(MID(A2,MATCH(1,INDEX((CODE(MID(A2,ROW($1:$255),1))>=65)*(CODE(MID(A2,ROW($2:$255),1))<90),),0)+1,255),"")

    and then just use SUBSTITUTE for the other word.
    Thank you for the additional solution!

+ 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] remove after three & four letters , keep the first three & four letters with shift capital
    By abdo meghari in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 04-30-2022, 07:43 AM
  2. Separating words based on Capital letters
    By ImranBhatti in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-24-2022, 03:37 AM
  3. Text to Columns by Capital Letters
    By miles44 in forum Excel General
    Replies: 15
    Last Post: 08-02-2016, 08:39 PM
  4. [SOLVED] Not differentiating between capital letters and lower case letters
    By Eliot Y in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-22-2015, 11:13 AM
  5. [SOLVED] Extract and separate the letters into their own separate columns
    By siroos12 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-22-2013, 10:18 AM
  6. [SOLVED] Need to separate continuous capital words of a string within a single cell
    By anchuri_chaitanya in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-17-2013, 02:56 AM
  7. Code to separate small from Capital letters
    By marcusr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-03-2007, 07:44 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