Topher
Topher

Reputation: 183

Concatenate if cell is not blank

I can't seem to find an answer that's working for me. Hoping an excel guru can help!

I am trying to build a concatenate formula which will only include one element if it's not blank. See the screenshot, I want to add the contents of the "utm_content" cell in column G, but only if it's got something in it. My hope is to get a reult for row 9 to look like this:

site_refer=cpc+b+tr+CAMPAIGNABCDE**+HORSE**&keyword_refer=Apples

My current formula is:

=CONCATENATE("site_refer=",B8,"+",D8,"+",E8,"+",F8,,G8,"&keyword_refer=",H8)

I can get HORSE to show up, but I can't seem to get a + symbol to be conditional along with it. I've been trying to get if statements to work, but it's erroring out every time.

concatenate

Upvotes: 0

Views: 1313

Answers (1)

Enigmativity
Enigmativity

Reputation: 117064

Are you trying to do this?

=CONCATENATE( "site_refer=",
               B8,
               "+",
               D8,
               "+",
               E8,
               "+",
               F8,
               IF(G8 = "" , "" , "+"&G8 ),
               "&keyword_refer=",
               H8 )

Upvotes: 3

Related Questions