rvfowler2
asked on
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?
Can any (all) of the three columns be blank?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This maybe?
=TRIM(CONCATENATE(A2,IF(A2 <>"",", ",""),B2,IF(B2<>"",", ",""),IF(C2<>"",C2, "")))
=TRIM(CONCATENATE(A2,IF(A2
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Oops, missed that. Nice work Barry.
ASKER
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).
-AddressConcat.xls
-AddressConcat.xls
ASKER
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.
=SUBSTITUTE(IF(A2="","",A2
Awarding points.
ASKER
Thanks. Hope my points are fair.
Seems that you got several good solutions and picked the best one for your needs. Works for me :)