11

enter image description here

I want to concatenate/combine columns A, B and C into column D as displayed.

The number of filled entries in A, B and C will vary over time, so absolute cell addresses cannot be used.

What formula could I put into D1 to fill the column as illustrated?

  • I'm aware that "append" may have been better vocabulary than "concatenate." Since concatenate is something you usually do with individual values. – Paulb Mar 6 '16 at 17:31
  • 1
    Maybe best answer to merge for statistical manipulation here where you do not need to filtering here webapps.stackexchange.com/a/69049/66725 So just use = {A1:A; B1:B}. Etc to count unique matches in two columns = count(unique(A1:A; B1:B})). – Léo Léopold Hertz 준영 Nov 10 '16 at 20:42
8

You need to filter down to non-empty cells, and then stack the results together:

={filter(A:A, len(A:A)); filter(B:B, len(B:B)); filter(C:C, len(C:C))}

This is the same as this answer by grayob which is unfortunately buried under outdated answers.

  • 1
    Worked perfectly. I saw that Q and I focused on the vmerge, unsuccessfully. In that Q, grayob's answer is better than the accepted answer. Tks. – Paulb Mar 6 '16 at 17:24
11

A shorter version of the formula in this other answer

=FILTER({A:A;B:B;C:C}, LEN({A:A;B:B;C:C}))
1

A little longer, but can be constrained to a limited array (not whole columns):

=transpose(split(textjoin("|",1,{A1:C4}),"|"))

where the order does not matter. Where it does:

=transpose(split(textjoin("|",1,{A1:A4;B1:B4;C1:C4}),"|"))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.