Home > database >  How to get the first name in a list or just pull the only name?
How to get the first name in a list or just pull the only name?

Time:10-14

We have a list of people in one cell. Unfortunately, the software we are using can only take one name from that list for the intended purpose/feature. So I need to pull the first name from that list and create a new column with just the first names from the list. Sometimes, there will be only one name. In that case, I need to just copy that name over.

enter image description here

So far, I have the formula that looks up everything to the left of the comma. But I need help crafting the IF part that will just copy the first name in the event that there is only one name.

=LEFT(B1,FIND(",",B1,1)-1)

What can I do so that I can just pull the one name from a cell in the event that there is only one name?

CodePudding user response:

IFERROR should fix it for you.

=IFERROR(LEFT(B1,FIND(",",B1,1)-1),B1)

  • Related