+ Reply to Thread
Results 1 to 9 of 9

Space after Capital Letter

  1. #1
    Forum Contributor
    Join Date
    05-06-2015
    Location
    Sri Lanka
    MS-Off Ver
    2016, 2007
    Posts
    135

    Space after Capital Letter

    I have Extracted names in column A.

    DinethPrabash
    JohnSmith
    WilliamTell
    RobinHood

    All follow this rule (no three names etc)

    I want to replace second capital letter with space (or any other delimiter) and that letter.

    e.g. Dineth Prabash
    John Smith

    So I can use text to column and make it two columns (first name, last name)
    can you help me?

    better if no macro.

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: Space after Capital Letter

    Here!

    =REPLACE(A1,LOOKUP(2,FIND(UPPER(MID(A1,ROW(INDIRECT("A1:A"&LEN(A1))),1)),MID(A1,ROW(INDIRECT("A1:A"&LEN(A1))),1)),ROW(INDIRECT("A1:A"&LEN(A1)))),0," ")
    Cheers!
    Deep Dave

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,944

    Re: Space after Capital Letter

    =TRIM(REPLACE(A1,MIN(INDEX(FIND(CHAR(ROW($65:$90)),A1&"ABCDEFGHIJKLMNOPQRSTUVWXYZ",2),0)),," "))
    Try this and copy towards down
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  4. #4
    Forum Contributor
    Join Date
    05-06-2015
    Location
    Sri Lanka
    MS-Off Ver
    2016, 2007
    Posts
    135

    Re: Space after Capital Letter

    both are great. thanks.

  5. #5
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: Space after Capital Letter

    Hi,

    Inspired from nflsales' solution, here is another one..

    =REPLACE(A1,LOOKUP(10^99,FIND(CHAR(ROW(65:90)),A1,2),FIND(CHAR(ROW(65:90)),A1,2)),0," ")

  6. #6
    Forum Contributor
    Join Date
    05-06-2015
    Location
    Sri Lanka
    MS-Off Ver
    2016, 2007
    Posts
    135

    Re: Space after Capital Letter

    OK, can anybody show me how these work? I am like blind here.

  7. #7
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: Space after Capital Letter

    Alright!

    =CHAR(ROW(65:90)) This piece generates Capital A - Z (Select the Formula in the Formula Bar and press F9 to see..) Press Ctrl+Z to undo later on.

    Then we use Find which is case sensitive to find any Capital Letter between A-Z starting from the 2nd Character (Very Important, as there can only be 1 cap letter after the 2nd character). The resulting array returns the character position.

    Then we use the char position with the replace function.. When 0 is used for the 3rd Argument of the Replace function, it actually inserts and not replaces the specified character which we define in the 4th argument, in our case a Space.

    And then you have your answer..
    Last edited by NeedForExcel; 09-10-2015 at 12:30 AM.

  8. #8
    Registered User
    Join Date
    11-13-2022
    Location
    Amman - Jordan
    MS-Off Ver
    2016 Use at work 365 at Home
    Posts
    27

    Re: Space after Capital Letter

    Sir your formula works well except for this word AliAhmed It NA

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

    Re: Space after Capital Letter

    This thread is eight years old ...
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

+ 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: 25
    Last Post: 04-21-2015, 10:19 AM
  2. lower case letter to capital letter
    By kuzna26 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-10-2014, 03:49 AM
  3. [SOLVED] first letter small case & all letter capital case any coding / any trick / any formula
    By sonu_kumar444 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-22-2012, 05:22 AM
  4. allow CAPITAL letter only
    By VICTOR5 in forum Excel General
    Replies: 3
    Last Post: 04-14-2011, 05:31 AM
  5. Replies: 5
    Last Post: 07-13-2006, 12:15 AM
  6. Default Capital letter for 1st letter of a word
    By Jeff in forum Excel General
    Replies: 6
    Last Post: 07-10-2006, 03:39 AM

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