question

BlantonChivon-3806 avatar image
0 Votes"
BlantonChivon-3806 asked JerryXu-MSFT answered

Created calculated column in SPO list to extract First and Last names from DisplayName between /n

I have a string column with displayNames joined with /n. There could be 1-20 names. I need a formula for extracting first names and another for last names while keeping the line breaks.

Thanks for any help!

Example: Lee, Sara\nCrocker, Betty\nHines, Duncan\nJim, Slim

Desired outputs:
Formula 1: Lee\nCrocker\nHines\nJim
Formula 2: Sara\nBetty\nDuncan\nSlim

office-sharepoint-online
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

JerryXu-MSFT avatar image
0 Votes"
JerryXu-MSFT answered

Hi, @BlantonChivon-3806 ,

Based on your requirements, I have to say using calculated column will not be a good option. It needs to have a very complicated nested if structure as you may have 1-20 names, and we cannot add a loop inside the calculated column. The suggested way will be using Power Automate (flow). I have made a demo in my end and works.

79029-image.png
If you have access to flow, I strongly recommended using it as the solution and will provide a simple graph for explanation if you need.


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


image.png (28.3 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.