Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

extracting last name

Featured Replies

I have a field named FullName from which I need to extract the last name into a separate field. I used the Calculatoin in the manual to do this when the field used the format of "FIrstName LastName" but we had to change the field to display "First Last, Title."

Can anyone help with a Calc to do this? A comma always follows the last name.

i.e.,

John Smith, MD --> Smith

Thanks!

We just had this topic.

See if this Link doesn't answer your questions. Be sure to follow any links, and download the example file(s)

HTH

Lee

  • Author

Thanks-is there an easier way using Position and one of the Word functions?

It will break with just about any entry other than one word last names.

RightWords (YourField; 1)

Edited by Guest

Try:

Let ( [

len = Length ( FullName ) ;

end = Position ( FullName ; "," ; len ; - 1 ) ;

start = Position ( FullName ; " " ; end ; - 1 ) + 1

] ;

Middle ( FullName ; start ; end - start )

)

  • Author

thanks--stupid question, though...where does the Let function go in the Calc for the lastname field?

In the calculation formula box? Or perhaps I don't understand your question.

  • Author

I haven't used the Let command before.

Would I just enter what you posted into the Calc definition for the LastName field?

Yes. Let() is a function like any other function.

...where does the Let function go in the Calc for the lastname field?

Yes.

  • Author

Works perfectly--thanks so much!!

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.