Michele Staffiere
Michele Staffiere

Reputation: 43

Joining text with IF functions

I'm trying to make a spreadsheet that contains first names, preferred first names, and last names. First Name, Preferred Name, and Last Name are all in separate columns.

I want to populate a 4th column with the persons full preferred name, Joining either First Name with Last Name or Preferred Name with Last Name. How would i achieve this in excel?

Below is an example of what I would like the finished product to resemble.

First Name Preferred Name Last Name Full Name
John Doe John Doe
Billy Bill Clark Bill Clark
Joseph Clark Joseph Clark
Mary Bell Doe Bell Doe

Upvotes: 0

Views: 164

Answers (3)

JohnyL
JohnyL

Reputation: 7152

You can also use TEXTJOIN function, if your Excel version supports it:

=TEXTJOIN(" ",,IF(B2="",A2,B2),C2)

Upvotes: 2

Scott Craner
Scott Craner

Reputation: 152660

Use:

=IF(B2="",A2,B2) & " " & C2

So if B2 is blank we choose A2. If B2 is not blank we choose B2. Then concatenate it with " " and whatever is in C2.

enter image description here

Upvotes: 2

alexb523
alexb523

Reputation: 738

Assuming your data starts in A1:

=IF(B2="",CONCAT(A2," ",C2), CONCAT(B2, " ", C2))

Upvotes: 1

Related Questions