# Revision history [back]

Hello,

try =IF(B2<>"";CONCATENATE(A2;" and";B2);A2) - but be absolutely sure that colum B doesn't contain anything (even not a space character), if there is no second name. Otherwise formula will fail.

Hello,

try =IF(B2<>"";CONCATENATE(A2;" and";B2);A2) - but be absolutely sure that colum column B doesn't contain anything (even not a space character), if there is no second name. Otherwise formula will fail.

Hello,

try =IF(B2<>"";CONCATENATE(A2;" and";B2);A2)and ";B2);A2) - but be absolutely sure that column B doesn't contain anything (even not a space character), if there is no second name. Otherwise formula will fail.

Hello,

try =IF(B2<>"";CONCATENATE(A2;" and ";B2);A2) - but be absolutely sure that column B doesn't contain anything (even not a space character), if there is no second name. Otherwise formula will fail.

Update 1 If you can't assure, that there are no withespaces in column B, you may use (example for cell C2): =IF(ISERROR(REGEX(B2;"^\s+$"));IF(B2="";A2;CONCATENATE(A2;" and ";B2));A2) or you use the same regular expression (^\s+$) in Edit -> Find & Replace to get rid of white spaces.

Hello,

try =IF(B2<>"";CONCATENATE(A2;" and ";B2);A2) - but be absolutely sure that column B doesn't contain anything (even not a space character), if there is no second name. Otherwise formula will fail.

Update 1 If you can't assure, that there are no withespaces white spaces in column B, you may use (example for cell C2): =IF(ISERROR(REGEX(B2;"^\s+$"));IF(B2="";A2;CONCATENATE(A2;" and ";B2));A2) or you use the same regular expression (^\s+$) in Edit -> Find & Replace to get rid of white spaces.

Hello,

try =IF(B2<>"";CONCATENATE(A2;" and ";B2);A2) - but be absolutely sure that column B doesn't contain anything (even not a space character), if there is no second name. Otherwise formula will fail.

Update 1 If you can't assure, that there are no white spaces in column B, you may use (example for cell C2): ):

=IF(ISERROR(REGEX(B2;"^\s+$"));IF(B2="";A2;CONCATENATE(A2;" and ";B2));A2) or you use the same regular expression (^\s+$) in Edit -> Find & Replace to get rid of white spaces.