Aman Vidura
Aman Vidura

Reputation: 85

Excel concatenate with IF condition

There are two cells A2 and B2.

If

the cell B2 isn't empty, then concatenate A2 and B2 separated by a ','

(A2,B2)

else

have A2 alone

Upvotes: 0

Views: 5965

Answers (2)

barry houdini
barry houdini

Reputation: 46331

Try this formula

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

Upvotes: 1

Bathsheba
Bathsheba

Reputation: 234635

Put, in any cell,

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

Upvotes: 3

Related Questions