+ Reply to Thread
Results 1 to 26 of 26

Split cell containing a lowercase letter followd by an uppercase letter with no space b/w

  1. #1
    Registered User
    Join Date
    01-02-2012
    Location
    Melbourne
    MS-Off Ver
    Excel 2003
    Posts
    63

    Split cell containing a lowercase letter followd by an uppercase letter with no space b/w

    I have a column containing names & job titles an i am trying to split them into separate columns.

    The issue is that the last letter (in lowercase) of the person's surname is immediately followed by the first letter (in uppercase) of the person's job title, but there is no space in between each. ie:

    John BlackSales Manager
    Sue RedSales Consultant
    David GreenSales Rep

    See image attached for what i would like it to look like.

    If i can find a way of replacing this occurrence with a comma, then i can do a 'text to column'. The issue is that i do not know how to replace it with a comma (or some other unique symbol).

    Any help would be great (greatly) appreciated.

    Cheers
    Rob
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Rob8489; 04-19-2015 at 08:51 PM. Reason: added excel file

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    I presume its too much to expect that the "split" is always on the word Sales?

    Please upload a sample of your workbook, not a picture of your data. Pictures are pretty much impossible to edit, and no-one wants to re-type your data for you
    Also, not all members can upload picture files (Company firewalls and stuff)

    Your workbook should show a small desensitized example of the data you are working with and a manual mockup of the expected results.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    01-02-2012
    Location
    Melbourne
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    Thanks mate, here is the spreadsheet with the example and desired result
    Attached Files Attached Files

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    Do you have a list of departments?

  5. #5
    Registered User
    Join Date
    01-02-2012
    Location
    Melbourne
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    i know where you are going with this, but no i dont, just the one column.

    I was hoping the lowercase and uppercase(with no space) could be replaced with a symbol

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    hmm Can probably be done with VBA, but if you had a list of Depts, this would work...
    A
    B
    C
    D
    9
    John BlackAccount Manager John Black, Account Manager Account Manager
    10
    Sue RedTechnology Consultant Sue Red, Technology Consultant Technology Consultant
    11
    David GreenSales Rep David Green, Sales Rep Sales Rep
    12
    Jack BlueFinance Manager Jack Blue, Finance Manager Finance Manager
    13
    Jason WhiteMarketing Consultant Jason White, Marketing Consultant Marketing Consultant
    14
    Amanda BrownSales Rep Amanda Brown, Sales Rep Sales Rep

    B9=LEFT(A9,SEARCH($D$9:$D$16,$A9)-1)&", "&MID(A9,SEARCH($D$9:$D$16,$A9),99)
    copied down

  7. #7
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,367

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    The formula is not mine I found here :

    http://www.mrexcel.com/forum/excel-questions/


    And I just make a little modification, this array formula (means when ENTERING this formula
    you need to press CTRL+SHIFT+ENTER button all together, not ENTER alone
    and then you can copied down as necessary)

    Hope this helps
    Attached Files Attached Files

  8. #8
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    Try this array formula in B2 and copy down

    =REPLACE(A2,MIN(IFERROR(FIND(CHAR(ROW($65:$90)),A2,FIND(" ",A2)+2),"")),,",")

    ***Array formula must be entered by using key combination of CTRL+SHIFT+ENTER and not just ENTER

    Row\Col
    A
    B
    1
    **Example of current state **Desired state / outcome
    2
    **John BlackAccount Manager John Black,Account Manager
    3
    **Sue RedTechnology Consultant Sue Red,Technology Consultant
    4
    **David GreenSales Rep David Green,Sales Rep
    5
    **Jack BlueFinance Manager Jack Blue,Finance Manager
    6
    **Jason WhiteMarketing Consultant Jason White,Marketing Consultant
    7
    **Amanda BrownSales Rep Amanda Brown,Sales Rep
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  9. #9
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    original outcome solution using CSE formula for 2nd formula

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

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  10. #10
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    Or if you want it split in two columns use this array formula

    in B2 and pull formula to the right and down

    =TRIM(MID(SUBSTITUTE(","&REPLACE($A2,LARGE(IFERROR(FIND(CHAR(ROW(A$65:A$90)),$A2),""),2),,", "),",",REPT(" ",50)),50*COLUMNS($A:A),50))

    ***Array formula must be entered by using key combination of CTRL+SHIFT+ENTER and not just ENTER


    Row\Col
    A
    B
    C
    1
    Example of current state Name Title
    2
    John BlackAccount Manager John Black Account Manager
    3
    Sue RedTechnology Consultant Sue Red Technology Consultant
    4
    David GreenSales Rep David Green Sales Rep
    5
    Jack BlueFinance Manager Jack Blue Finance Manager
    6
    Jason WhiteMarketing Consultant Jason White Marketing Consultant
    7
    Amanda BrownSales Rep Amanda Brown Sales Rep
    Last edited by AlKey; 04-19-2015 at 10:27 PM.

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    Quote Originally Posted by AlKey View Post
    Try this array formula in B2 and copy down

    =REPLACE(A2,MIN(IFERROR(FIND(CHAR(ROW($65:$90)),A2,FIND(" ",A2)+2),"")),,",")
    Doesn't work on 3 word names if there might be any.

    Edward Van HalenMusical Director
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  12. #12
    Registered User
    Join Date
    01-02-2012
    Location
    Melbourne
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    Quote Originally Posted by humdingaling View Post
    original outcome solution using CSE formula for 2nd formula

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

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

    Thank you, very helpful

    Just wondering if we can add a rule to the formula. The rule would apply to surnames that has a lowercase and uppercase letter (with no space), for example 'McBlack'. Ive attached the example.

    Maybe the rule could be that if there are two occurrences in the cell, apply the split to the second occurrence.

    Hopefully that's doable. See attached
    Attached Files Attached Files

  13. #13
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    was looking at this...and Tony's additional about the space in Surname issue

    i think the simplest/best option would be going back to Fdibbins one whereby you have a list of Titles to look up against
    that way it really doesnt really matter how your name is spelt

    However to answer your question
    you could increase the section after " " to +4 like so
    Please Login or Register  to view this content.
    however this will cause issues with short surnames...like Ng
    Last edited by humdingaling; 04-20-2015 at 12:43 AM.

  14. #14
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    using the table of titles method
    Attached Files Attached Files

  15. #15
    Forum Contributor
    Join Date
    03-11-2014
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    379

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    Quote Originally Posted by Rob8489 View Post
    Thanks mate, here is the spreadsheet with the example and desired result
    Hi Rob,

    The fastest way would be to use Flash Fill feature available in Excel 2013 version.
    You will get the result within a second.

    Regards,
    AM

  16. #16
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    ashishmehra2010, what am I missing here? How would that break the names out, as requested?

  17. #17
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    Quote Originally Posted by FDibbins View Post
    ashishmehra2010, what am I missing here? How would that break the names out, as requested?
    It is a new feature that was introduced in Excel 2013. You do it manually once and excel remembers the pattern and repeats it.

    https://support.office.com/en-us/art...2-c4dc84d49464

  18. #18
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    Haven't tried all of the other formulas or uploads but this takes care of the three names, too. Array-entered.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  19. #19
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    AlKey, cool. I tried it, but couldnt get it to work - kept telling me it couldnt see a pattern

  20. #20
    Banned User!
    Join Date
    10-29-2012
    Location
    Europe
    MS-Off Ver
    2013, 2016
    Posts
    318

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    Quote Originally Posted by FDibbins View Post
    AlKey, cool. I tried it, but couldnt get it to work - kept telling me it couldnt see a pattern
    In Excel 2013.
    In column A put those names and in B1 put what is in A1 but how should then be. With cell B1 selected, click on the DATA tab and clic flash fill.

    Sorry for my English.

  21. #21
    Forum Contributor
    Join Date
    03-11-2014
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    379

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    Quote Originally Posted by FDibbins View Post
    ashishmehra2010, what am I missing here? How would that break the names out, as requested?
    Hi Ford,

    Kindly check AutoFill feature is enable. Refer to: https://www.ablebits.com/office-addi...utofill-excel/

    Regards,
    AM

  22. #22
    Forum Contributor
    Join Date
    03-11-2014
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    379

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    Quote Originally Posted by Indi_Ra View Post
    In Excel 2013.
    In column A put those names and in B1 put what is in A1 but how should then be. With cell B1 selected, click on the DATA tab and clic flash fill.

    Sorry for my English.
    You can use CTRL + E shortcut key

    Regards,
    AM

  23. #23
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    Quote Originally Posted by Tony Valko View Post
    Doesn't work on 3 word names if there might be any.

    Edward Van HalenMusical Director
    Is that what he's calling himself now?! And "Edward" doesn't quite have the same, wild ring to it somehow!
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  24. #24
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    That's what DLR calls him.

    They're going on tour!

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

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    Taking AlKey's formula that inserted a comma between the name and the Position, the names and positions can be separated into two columns this way (two names only)

    In B2 Array enter and fill down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    In C2 enter and fill down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Result:

    A
    B
    C
    1
    Example of current state Name Position
    2
    John BlackAccount Manager John Black Account Manager
    3
    Sue RedTechnology Consultant Sue Red Technology Consultant
    4
    David GreenSales Rep David Green Sales Rep
    5
    Jack BlueFinance Manager Jack Blue Finance Manager
    6
    Jason WhiteMarketing Consultant Jason White Marketing Consultant
    7
    Amanda BrownSales Rep Amanda Brown Sales Rep
    <---------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

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

    Re: Split cell containing a lowercase letter followd by an uppercase letter with no space

    If you want to make the real easy, use Find and Replace in Word.
    Copy the Excel column into Word. It will be a Word table. When finished, copy back to Excel.

    The number of names and initials doesn't matter. The following will place a comma followed by a space wherever a lower case letter is immediately followed by an upper case letter. If you don't want the space after the comma, leave it out of the Replace with statement.

    In the Find what: enter ([a-z])([A-Z])
    In the Replace with: enter \1, \2

    Select Use wildcards
    Replace All.

+ 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: 7
    Last Post: 06-05-2014, 02:50 AM
  2. [SOLVED] Convert first letter of every word to Uppercase . Not Proper casing
    By rampulaparthi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-27-2013, 04:46 AM
  3. [SOLVED] Finding an uppercase letter in a string parameter of a UDF
    By dredwolf in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-22-2012, 11:43 PM
  4. Determining Any Uppercase Letter
    By CrazyFileMaker in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-22-2009, 10:19 PM
  5. Replies: 2
    Last Post: 07-26-2005, 03:05 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