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

Blanton, Chivon 21 Reputation points

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

A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,249 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jerry Xu-MSFT 7,941 Reputation points

    Hi, @Blanton, Chivon ,

    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.

    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.

    0 comments No comments

0 additional answers

Sort by: Most helpful