Combine three columns into one

matthewR
5StarLounger
Posts: 627
Joined: 03 Feb 2010, 15:02

Combine three columns into one

Post by matthewR »

I have three columns that I would like to combine into one. I want the column with data to fill the 4th column. One of the 3 columns has data and the other two don't per row so I just want one column to reflect all 3 columns. The columns are E, F and G and I want H to have all three. How would I formulate an IF statement for this?

User avatar
HansV
Administrator
Posts: 78492
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Combine three columns into one

Post by HansV »

For text values, you can simply concatenate: if your data start in row 1, try the following formula in H1

=E1&F1&G1

and fill down.

For numeric or date values, try

=IF(ISBLANK(E1),IF(ISBLANK(F1),G1,F1),E1)

If columns E, F and G contain dates, you'll have to format column H as a date too.
Best wishes,
Hans

matthewR
5StarLounger
Posts: 627
Joined: 03 Feb 2010, 15:02

Re: Combine three columns into one

Post by matthewR »

I looked at the data closer and this is what I need. The data is text. I need what is in Column E if it is not blank. If it is blank then I need what is in one of the other columns - the one that has data. I always need column E if not blank. If column E has data and say column G has data, then I need column E always. I was finding that column E and G had data on the same row sometimes.

I just need column E and the other two columns only when E is blank. Hope this makes sense.

User avatar
HansV
Administrator
Posts: 78492
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Combine three columns into one

Post by HansV »

Does this do what you want?

=IF(ISBLANK(E1),IF(ISBLANK(F1),G1,F1),E1)
Best wishes,
Hans

User avatar
sdckapr
3StarLounger
Posts: 392
Joined: 25 Jan 2010, 12:21

Re: Combine three columns into one

Post by sdckapr »

If 2 are blank and only 1 has numeric data, you could just use:
=Sum(E1:G1)

Steve

User avatar
HansV
Administrator
Posts: 78492
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Combine three columns into one

Post by HansV »

That's much simpler for numeric values, and it works for dates too if only one column is filled in each row.
Best wishes,
Hans