Excel Concatenating Addresses Without Showing Blank Fields

I have an exported Excel file with the address in 3 different columns and want to combine them into one column.  Looked up merge cells and tried it but it wasn't helpful.  Tried writing a concatenation formula and adding commas between say the address and suite number, which worked; however, I don't want to include a comma and space when the suite field is empty.  Any suggestions?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Can any (all) of the three columns be blank?
Make the commas conditional by using the IF function, something like this:
CONCATENATE(cell1, IF( cell1 = '', '', ',' ), cell2, IF( cell2 = '', '', ',' ), cell3 )

Open in new window

What formula do you have now?
What is in the 3 cells?
Where does the suite number come from?

Typically, you'd do something like this (or the corresponding CONCATENATE command):

=A1 & ", " & A2 & ", " & A3

However, to skip A2 if blank, use something like this:

=A1 & ", " & IF(A2="", "", A2 & ", ") & A3

HTML5 and CSS3 Fundamentals

Build a website from the ground up by first learning the fundamentals of HTML5 and CSS3, the two popular programming languages used to present content online. HTML deals with fonts, colors, graphics, and hyperlinks, while CSS describes how HTML elements are to be displayed.

This maybe?

=TRIM(CONCATENATE(A2,IF(A2<>"",", ",""),B2,IF(B2<>"",", ",""),IF(C2<>"",C2, "")))
Small change:

=TRIM(CONCATENATE(IF(A2<>"",A2&", ",""),IF(B2<>"",B2&", ",""),IF(C2<>"",C2, "")))
barry houdiniCommented:
..but that would still give you a trailing comma if, say, A2 and B2 only are populated.

Try this to avoid that

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

regards, barry

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Oops, missed that. Nice work Barry.
rvfowler2Author Commented:
OK, an IF statement just like Filemaker.  This is close, but you need to account for a blank first cell as well.  Attaching file that gives all possible combos and will give credit to somone if they get it before me (though will give partial to all if you don't since you pointed me in the right direction).
rvfowler2Author Commented:
Figured it out.  The only change was in the first part of the calc, to put the comma (but in this case it would be a period) AFTER the cell (A2) as follows:

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

Awarding points.
rvfowler2Author Commented:
Thanks.  Hope my points are fair.
Seems that you got several good solutions and picked the best one for your needs.  Works for me :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.