1 Reply Latest reply on Aug 6, 2011 2:59 PM by LaRetta_1

    extracting last name from full name

    denno

      Title

      extracting last name from full name

      Post

      I have a calc field to extract the last name from a full name field in the format SMITH, JOHN.

      The formula is LeftWords(fullname;1).

       

      I need to be able to extract the last name when it has a space, e.g., VAN BEETHOVEN, LUDWIG. My current formula returns VAN. If I change the formual to (fullname; 2) I get VAN BEETHOVEN but also SMITH, JOHN for last name.

       

      Is there a way to do this?

      Thanks-

        • 1. Re: extracting last name from full name
          LaRetta_1

          You use the comma to split last from first, something like:

          Let ( split = Substitute ( FullName ; ", " ; ¶ ) ; GetValue ( split ; 1 ) ) ... gives you the Last Name.  Change the red 1 to a 2 to get the first name.  You can also find the position of the comma but this method is simpler.