Home > Mobile >  Joining text with IF functions
Joining text with IF functions

Time:04-12

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

CodePudding user response:

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

CodePudding user response:

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

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

CodePudding user response:

Assuming your data starts in A1:

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

  • Related