How to concatenate columns in Excel

  • Thread starter Thread starter M_1
  • Start date Start date
  • Tags Tags
    Columns Excel
AI Thread Summary
To concatenate two columns in Excel without specifying the exact cell references, users can utilize macros to automate the process. While Excel does not provide a straightforward method for this task, a macro can dynamically identify the last occupied cell in each column. By using the command Range("A1").End(xlDown"), users can find the last non-empty cell in column A, allowing for the creation of a new column C that combines the data from both columns A and B. This approach eliminates the need for manual input regarding the number of non-empty cells in each column. For further guidance, Microsoft offers resources on combining text from multiple cells.
M_1
Messages
30
Reaction score
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
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.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
What percentage of programmers have learned to touch type? Have you? Do you think it's important, not just for programming, but for more-than-casual computer users generally? ChatGPT didn't have much on it ("Research indicates that less than 20% of people can touch type fluently, with many relying on the hunt-and-peck method for typing ."). 'Hunt-and-peck method' made me smile. It added, "For programmers, touch typing is a valuable skill that can enhance speed, accuracy, and focus. While...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top