How to concatenate columns in Excel

In summary, the conversation is about how to combine data from two columns in Excel into a third column without knowing the number of non-empty cells in each column. While this cannot be done directly in plain Excel, it is possible with macros or by using the "CONCATENATE" function. The recommended method is to use the "Range" function to get the last occupied cell in one of the columns and use that information to concatenate the data. More information and instructions on how to do this can be found in the provided link.
  • #1
M_1
31
1
Say I have two columns containing data in Excel. Column A contains 10 non empty cell and column B contains 12 non empty cells. How can I create a column C with 10 + 12 cells without specifically telling Excel to put cell B1 in cell C11. In other words I would like to concatenate column A and B into column C without knowing the number of non empty cells in A or B.
 
Technology news on Phys.org
  • #2
I don't think you can in plain Excel. You can with macros, though. Range("A1").End(xlDown) will return the last occupied cell below A1 (End acts like control and the down arrow key, so careful that A2 isn't empty). You can get the row from there.
 

Related to How to concatenate columns in Excel

1. How do I combine columns in Excel using a formula?

To concatenate columns in Excel, you can use the CONCATENATE function or the ampersand (&) operator. Simply select the cell where you want the combined columns to appear, enter the formula =CONCATENATE(A1,B1) or =A1&B1 (where A1 and B1 are the cells containing the data you want to combine), and press Enter. The combined data from the two columns will appear in the selected cell.

2. Can I combine columns in Excel without using a formula?

Yes, you can combine columns in Excel without using a formula by using the Merge Cells feature. Select the cells you want to merge, right-click, and select "Merge Cells" from the dropdown menu. This will combine the selected cells into one, with the data from the leftmost cell appearing in the merged cell.

3. How can I insert a space between the combined columns in Excel?

To insert a space between the combined columns in Excel, you can use the CONCATENATE function or the ampersand (&) operator, along with the space character (" "). For example, using the formula =A1&" "&B1 will combine the data from columns A and B with a space in between.

4. Is there a limit to the number of columns I can combine in Excel?

No, there is no limit to the number of columns you can combine in Excel. However, it is important to note that the more columns you combine, the longer the combined data may become, potentially causing issues with data formatting and readability.

5. Can I combine columns from different sheets in Excel?

Yes, you can combine columns from different sheets in Excel by using the CONCATENATE function or the ampersand (&) operator, along with the sheet name and an exclamation mark (!). For example, the formula =Sheet1!A1&Sheet2!B1 will combine the data from cell A1 in Sheet1 with the data from cell B1 in Sheet2.

Similar threads

Replies
1
Views
660
  • Programming and Computer Science
Replies
8
Views
964
  • Computing and Technology
Replies
9
Views
984
  • Programming and Computer Science
Replies
7
Views
551
Replies
9
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
2K
  • Programming and Computer Science
Replies
4
Views
947
  • Programming and Computer Science
Replies
4
Views
1K
  • Programming and Computer Science
Replies
5
Views
2K
  • Programming and Computer Science
Replies
18
Views
5K
Back
Top