if statement: if Y, then concatenate three columns into one

I am in urgent need of help.
I have an excel with a lot of data that needs to copied into Word document.

Let's say there are four columns in my Excel. Three columns of data (A, B, C) and one column (D) with Y/N indicator. If D is Y, I need to concatenate data from A, B, and C columns and populate in E column. It sounds very basic, but I have not done this before and in urgent need of this.

Thank you in advance for your help.

Nick's picture

concatenate range

put this in E2
=IF(D2="Y",A2&B2&C2,"")

RE: If statement...

Hi,

You can use one of the following formulas (or some similar), depending on your needs:

 = IF(D1 = "Y", A1 & " " & B1 & " " & C1, "")

 = IF(D1 = "Y", A1 & "-" & B1 & "-" & C1, "")

 = IF(D1 = "Y", A1 & B1 & C1, "")

If, for example, A1 = Arthur, B1 = Conan, C1 = Doyle, the above formulas will return respectively:

 Arthur Conan Doyle

 Arthur-Conan-Doyle

 ArthurConanDoyle

 

Best regards.