Avatar of CynSzcz
CynSzczFlag for United States of America asked on

Merging cells "only if" second cell is populated

I need to merge info from two Excel columns into one.  Know how to do that. But, I need to insert a semicolon between info from each column "only if" the second column has info.  Not all second columns will be populated when the merge is conducted.  I don't want to end up with "info:nothing."  Want to have "info:info" only when it applies.  Does that make sense?
Microsoft OfficeMicrosoft Excel

Avatar of undefined
Last Comment

8/22/2022 - Mon
Raheman M. Abdul

col A and col B has data

resultant col formula


Thanks Wizard,
Your solution worked for the columns that both have info (filled in from both sides with colon in center), but I also need to have the third column filled even if it is just from one column but without the colon inserted and nothing after it.  (Examples:  if two columns both contain info, need both info and semicolon;  if only column has info - need that info to come into new column "without" a semicolon after it.)
Raheman M. Abdul

The solution i posted does give you the values in the both columns with : at the middle when both the columns are populated.
If there is not data in 2nd column, only the first column data is in the result (without :)

Can you send me the excel sheet for sample please. cant get your point.
Your help has saved me hundreds of hours of internet surfing.

I appreciate your assistance.  I cannot send sheet because info does not belong to me.  I ran your formula and the only cells populated in the new column are cells where info came in from both of the other columns and are separated by the semicolon.  If there was only info in one of the initial columns (not both) then the cell in the new column is empty.  It worked perfect.  But I need ALL cells in the new column populated even if there was only info from one column moved to it.

What i am trying to say is "if two cells are merged and there was info in both then I need a semicolon inserted.  If two cells are merged and info is only coming in from one column then I need that info but will not require the semicolon.

column B will always have info; column A "may" have info.  Sorry, should have mentioned that in the beginning.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.

Example of sheet.  Need column C populated in all cases.
Raheman M. Abdul

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question