+ Reply to Thread
Results 1 to 21 of 21

Delete fifth Name

  1. #1
    Registered User
    Join Date
    08-29-2014
    Location
    Abu Dhabi
    MS-Off Ver
    2003
    Posts
    303

    Delete fifth Name

    I want to separate the first four names without the "title" even if it had been compound , In other words, delete the fifth even if the name "compound name"
    Such as "Abd, Abu, Gad"
    Attached Files Attached Files

  2. #2
    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,464

    Re: Delete fifth Name

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



    Regards, TMS
    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


  3. #3
    Registered User
    Join Date
    08-29-2014
    Location
    Abu Dhabi
    MS-Off Ver
    2003
    Posts
    303

    Re: Delete fifth Name

    You're a genius Mister "TMS"
    Thank you very much for this wonderful formula

  4. #4
    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,464

    Re: Delete fifth Name

    You're welcome.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  5. #5
    Registered User
    Join Date
    08-29-2014
    Location
    Abu Dhabi
    MS-Off Ver
    2003
    Posts
    303

    Re: Delete fifth Name

    I have asked if you want to put a condition Name of the compound under the terms of the formula
    How to be formed
    Thank you again

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

    Re: Delete fifth Name

    if you want to put a condition Name of the compound under the terms of the formula

    I have no idea what that means

  7. #7
    Registered User
    Join Date
    08-29-2014
    Location
    Abu Dhabi
    MS-Off Ver
    2003
    Posts
    303

    Re: Delete fifth Name

    This formula to separate the last name of the Full Name
    Can you make it separating the Full Name without Last Name
    =IF(OR(ISNUMBER(SEARCH({"Abd","Abou","Gab","Gad"},RIGHT($A2,LEN($A2)-3)))),TRIM(RIGHT(SUBSTITUTE($A2," ",REPT(" ",255)),255*2)),TRIM(RIGHT(SUBSTITUTE($A2," ",REPT(" ",255)),255)))

  8. #8
    Registered User
    Join Date
    08-29-2014
    Location
    Abu Dhabi
    MS-Off Ver
    2003
    Posts
    303

    Re: Delete fifth Name

    Any help to do this formula

  9. #9
    Registered User
    Join Date
    08-29-2014
    Location
    Abu Dhabi
    MS-Off Ver
    2003
    Posts
    303

    Re: Delete fifth Name

    Any help please

  10. #10
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Delete fifth Name

    Can you give an example of what you want to do, as you did for your first question. Thanks
    Audere est facere

  11. #11
    Registered User
    Join Date
    08-29-2014
    Location
    Abu Dhabi
    MS-Off Ver
    2003
    Posts
    303

    Re: Delete fifth Name

    Is the same question , but I want this formula you delete a name , even if the latter compound

    This formula to separate the last name of the Full Name
    Can you make it separating the Full Name without Last Name
    =IF(OR(ISNUMBER(SEARCH({"Abd","Abou","Gab","Gad"},RIGHT($A2,LEN($A2)-3)))),TRIM(RIGHT(SUBSTITUTE($A2," ",REPT(" ",255)),255*2)),TRIM(RIGHT(SUBSTITUTE($A2," ",REPT(" ",255)),255)))
    Attached Files Attached Files
    Last edited by shimaa01234; 09-29-2014 at 10:02 AM.

  12. #12
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Delete fifth Name

    OK, are you still trying to do what you asked originally? In which case I'm not sure I understand what that is, can you explain the logic?

  13. #13
    Registered User
    Join Date
    08-29-2014
    Location
    Abu Dhabi
    MS-Off Ver
    2003
    Posts
    303

    Re: Delete fifth Name

    I want the formula found in "Test2 " are bringing the first four names
    They are bringing Last Name

  14. #14
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Delete fifth Name

    Sorry, I know I'm not providing any solutions but I think that if you want a solution to your problem that's long-lasting and robust you need to provide a fuller explanation with a variety of examples.

    So far here's a list of things I don't understand

    You are talking about "fifth name" and "first four names" but if this list of words need to be discounted

    "Abd","Abou","Gab","Gad"

    then some of your example have only 3 names, is that right?

    Please understand that I don't necessarily understand the details of what you require - I don't know why you are excluding that list, those are titles right?

    The formula you quote, i.e.

    =IF(OR(ISNUMBER(SEARCH({"Abd","Abou","Gab","Gad"},RIGHT($A2,LEN($A2)-3)))),TRIM(RIGHT(SUBSTITUTE($A2," ",REPT(" ",255)),255*2)),TRIM(RIGHT(SUBSTITUTE($A2," ",REPT(" ",255)),255)))

    .....Is showing the last 2 words in the cell if one of "Abd","Abou","Gab","Gad" is present, the last word otherwise.....but that will only work if "Abd","Abou","Gab","Gad" is attached to that last name, with multiple names in the cell I don't see how that wll work.

    So, what you should do, is this:

    Provide a small but representative list of examples, including all possible types of cases
    Without reference to formulas give a verbal explanation of what is required
    Also provide an example of what the full output should be

    Thanks

  15. #15
    Registered User
    Join Date
    08-29-2014
    Location
    Abu Dhabi
    MS-Off Ver
    2003
    Posts
    303

    Re: Delete fifth Name

    Simply,iwant this formula to delete last name

  16. #16
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Delete fifth Name

    Formulas don't delete things, they only read things. You can have a formula only show certain things, but it will never delete something.
    You should hit F5, because chances are I've edited this post at least 5 times.
    Example of Array Formulas
    Quote Originally Posted by Jacc View Post
    Sorry, your description makes no sense. I just made some formula that looks interesting cause I had nothing else to do.
    Click the * below on any post that helped you.

  17. #17
    Registered User
    Join Date
    08-29-2014
    Location
    Abu Dhabi
    MS-Off Ver
    2003
    Posts
    303

    Re: Delete fifth Name

    Well I want the formula to hide last name
    I wish to be the same terms as the formula
    Last edited by shimaa01234; 09-29-2014 at 11:14 AM.

  18. #18
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Delete fifth Name

    Here try this absurd formula

    =TRIM(LEFT(A2,FIND(" ",MID(A2,FIND(" ",MID(A2,FIND(" ",MID(A2,FIND(" ",A2)+1,LEN(A2)),2)+FIND(" ",A2),LEN(A2)),(FIND(" ",MID(A2,FIND(" ",A2)+1,LEN(A2)),2)+FIND(" ",A2)))+FIND(" ",MID(A2,FIND(" ",A2)+1,LEN(A2)),2)+FIND(" ",A2),LEN(A2)),1)+FIND(" ",MID(A2,FIND(" ",MID(A2,FIND(" ",A2)+1,LEN(A2)),2)+FIND(" ",A2),LEN(A2)),(FIND(" ",MID(A2,FIND(" ",A2)+1,LEN(A2)),2)+FIND(" ",A2)))+FIND(" ",MID(A2,FIND(" ",A2)+1,LEN(A2)),2)-1))

  19. #19
    Registered User
    Join Date
    08-29-2014
    Location
    Abu Dhabi
    MS-Off Ver
    2003
    Posts
    303

    Re: Delete fifth Name

    Unfortunately, the formula did not work, I think because I use Office 2003

  20. #20
    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,464

    Re: Delete fifth Name

    Given this list of names:

    HTML Code: 

    What do you want to get the formula to display ... and what are the "rules" that you apply for that to happen. Forget the formula for the moment. Just explain the logic of selecting the parts of the name you want to display.

    And yes, that formula can't work if you are using Excel 2003.

  21. #21
    Registered User
    Join Date
    08-29-2014
    Location
    Abu Dhabi
    MS-Off Ver
    2003
    Posts
    303

    Re: Delete fifth Name

    Rules, which I want to use :
    1- I want to hide the fifth name
    2. If the the name is preceded by the fifth "abd, abou, gad" is deleted with the fifth Name
    3- If the name is composed of the names of four or less left as is

+ 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: 1
    Last Post: 11-30-2013, 06:37 AM
  2. Macro to delete certain columns and delete rows based on time in another column
    By beepbeep27 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2012, 11:47 AM
  3. [SOLVED] Macro to delete sheets and saves remaining file does not properly delete module
    By pherrero in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-21-2005, 08:12 PM
  4. Replies: 0
    Last Post: 06-21-2005, 01:05 PM
  5. [SOLVED] Re: Macro to delete sheets and saves remaining file does not properly delete module
    By pherrero in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-21-2005, 01:05 PM

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