Brian Dunning's FileMaker Custom Functions

SurnameOnly ( text )

Extracts the surname from the tipical "Surname, Name" field.

  Average rating: 4.6 (24 votes) Log in to vote

Javier Dura   Javier Dura - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
SurnameOnly ( "Knight Smith, Michael" )
  Sample output:
Knight Smith

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Sometimes you have to work with a field that contains names formated like this: "Surname, Name".
This super simple custom function extracts only the surnames (note that in some countries people have more than one surname).
See also the "NameOnly" Custom Function.



Julian Garcia   Julian Garcia, Madrid
Jan 9, 2013
Muy Ăștil, es una buena idea.


Great, very usefull.

Thanks Javier
Edward   Edward, Auckland
Jul 21, 2014
Thanks for example to extract double Surname 'Knight Smith'

How do I extract the first name from example:
Surname, FirstName when the first name is double 'Mary Anne'?
Knight Smith, Mary Anne
Javier   Javier, Valencia, Spain
Jul 21, 2014
Hi, Edward.

In order to extract the first name, you should use another custom function called "NameOnly":

Log in to post comments.


Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 15 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: