Finding the first word and last word in a string - use case: splitting full name into first and last name

Can anyone help me do this in Coda?
In excel it is done as explained here
It feels like we are missing the “find” function but maybe there is a workaround?
Any help is appreciated!

Hello @Michael_Skok ,

Concerning the formula to find the first or the last element of a list for example, please consult the doc at this page (First, Last, Nth, and Slice | Coda Help Center)

Sincerely,

Thierry

Hey there!

To account for variations in names (and individuals who have two first names) this is the most secure method I have found:

For last name

For first name

Simpler methods would include:

fullName.split(" ").first() //First Name
fullName.split(" ").last() //Last Name

But this won’t account for all circumstances

1 Like

In the First Name column use the formula:
thisRow.Person.Name.Split(" ").First()

In the Last Name column use the formula:
thisRow.Person.Name.Split(" ").Last()

Technically the First and Last refer to the first and last items in a list not the first and last name.

2 Likes

Super helpful @Thomas_Oldroyd - thank you so much for joining the community and this as an example of a great reason we need people like you in it!
Best, Michael

Thank you so much @Scott_Collier-Weir - I appreciate the detail too!

Thanks @Thierryvm that’s just the pointer I need and I will read the docs to learn more too!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.