• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Concatenate properly so that blank spaces are not considered

vivekd5

New Member
Hi, I'm trying to concatenate 6 cells using the forumula:

=CONCATENATE(A15&"_",B15,"_",C15,"_",D15,"_",E15,"_",F15) which gives the result of

AA_BB_CC_DD_EE_FF

However, some of the cells are blank so it doubles the underscores as in the example below:

=CONCATENATE(A15&"_",B15,"_",C15,"_",D15,"_",E15,"_",F15)

GG_HH__II__JJ.

I want to remove the extra underscore so it appears like

GG_HH_II_JJ.

How can I do that? Please help.

Thanks,
Vivek
 
Welcome to Chandoo.org forums.

Are the columns constant? If yes, following workaround should help you.
=SUBSTITUTE(TRIM(CONCATENATE(A15," ",B15," ",C15," ",D15," ",E15," ",F15))," ","_")
 
Back
Top