+ Reply to Thread
Results 1 to 9 of 9

Separate Values into Column B & C Using Right, Left, Mid, Search, or Substitute function

  1. #1
    Forum Contributor
    Join Date
    02-06-2013
    Location
    Maryland
    MS-Off Ver
    Excel 2010
    Posts
    1,000

    Separate Values into Column B & C Using Right, Left, Mid, Search, or Substitute function

    Looking for the correct combination of Right, Left, Search,Mid, or Substitute function to look into column A2:A181 and separate values into column B2:B181 (heading is Split I) and column C2:C181 (heading is Split 2). Desired outcome is in column B2:B181 and C2:C181. See sample file.

    Thanks.
    Last edited by bjnockle; 05-04-2021 at 03:53 PM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,258

    Re: Right, Left, Mid, Search, or Substitute function to separate values into Column A and

    in B2

    =IFERROR(LEFT(A2,FIND(".,",A2,1)-1),LEFT(A2,FIND(",",A2,1)-1))
    in C2

    =SUBSTITUTE(A2,B2&",","")

    But

    De Nault, IV, Smithburg
    G.V.K., Sr., Landlonder
    Labogina III, Dr, Nowadays

    not handled

    There no logic which differentiates between cases which 2 commas

    James M., Moroney, III with result James M. and Moroney, III

    vs

    De Nault, IV, Smithburg with result De Nault, IV and Smithburg
    Last edited by JohnTopley; 05-03-2021 at 04:01 AM.

  3. #3
    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,508

    Re: Right, Left, Mid, Search, or Substitute function to separate values into Column A and

    @JT: you could convert the first comma to a special character, say "|", and then FIND the "|" for the split. Too tired to look at it now ... been spending a lot of time on another thread and watching the snooker.
    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


  4. #4
    Forum Contributor
    Join Date
    02-06-2013
    Location
    Maryland
    MS-Off Ver
    Excel 2010
    Posts
    1,000

    Re: Right, Left, Mid, Search, or Substitute function to separate values into Column A and

    JohnTopley: Please take a look and see if you are able to apply TMS suggestion to address De Nault, IV, Smithburg, G.V.K., Sr., Landlonder and Labogina III, Dr, Nowadays

    Thanks

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,258

    Re: Right, Left, Mid, Search, or Substitute function to separate values into Column A and

    I did look at TMS's suggestion but it does not resolve the problem. See below

    De Nault| IV, Smithburg

    G.V.K.| Sr., Landlonder

    Labogina III| Dr, Nowadays

    I am sorry but for me it is diminishing returns given the (small ?) number of manual interventions that might be required.

  6. #6
    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,508

    Re: Separate Values into Column B & C Using Right, Left, Mid, Search, or Substitute functi

    Please see the attached updated sample. I have applied the suggestion that I made. There are 13 anomalies (out of 180 entries) where the "rules" do not appear to be consistent. Note that I needed to Trim the manual Split 2 entries for the comparison as many of them included leading spaces.

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

    Re: Separate Values into Column B & C Using Right, Left, Mid, Search, or Substitute functi

    It looks to me as if the structure of the anomalous names is inconsistent. In some cases, you could get away with removing the first comma but that's not so for all of them.

    I think John is correct in his viewpoint.

  8. #8
    Forum Contributor
    Join Date
    02-06-2013
    Location
    Maryland
    MS-Off Ver
    Excel 2010
    Posts
    1,000

    Re: Right, Left, Mid, Search, or Substitute function to separate values into Column A and

    JohnTopley: For De Nault, IV, Smithburg, this formula works (
    =LEFT(A4,FIND("!",SUBSTITUTE(A4,",","!",LEN(A4)-LEN(SUBSTITUTE(A4,",",""))))-1)) for De Nault, IV, Smithburg, but still need to add it to the one you proposed to make it work. Are you able to take a look and see if it is doable? Thanks for your help with this.

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,258

    Re: Right, Left, Mid, Search, or Substitute function to separate values into Column A and

    The simple answer is no because there isn't a way of determining when to apply the general formula I gave vs. the very specific one needed to solve the few anomalies [ other than testing for the specific names which defeats the objective:; other anomalies could arise in another sample]

+ 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] Left, Right, Mid, or Substitute function to separate values into desired columns
    By bjnockle in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-02-2021, 10:40 AM
  2. Right function, Left function, Mid function to extract values in column A
    By bjnockle in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 06-14-2020, 03:14 PM
  3. [SOLVED] Extract texts from cell using SUBSTITUTE, RIGHT, LEFT, or MID FUNCTION
    By bjnockle in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-20-2020, 10:12 PM
  4. Replies: 7
    Last Post: 06-02-2017, 03:18 PM
  5. [SOLVED] How to replace or substitute function formulas but left the cell reference intact?
    By Franky alta in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 05-02-2016, 12:48 AM
  6. [SOLVED] Need help to separate numeric values into separate cells (LEFT and RIGHT won't work)
    By RichMcc in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-27-2013, 07:48 PM
  7. Substitute to the Search Function?
    By hekla149 in forum Excel General
    Replies: 3
    Last Post: 01-17-2011, 09:36 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