Are you having difficulty merging two or more Excel columns? Knowing how to combine multiple columns in Excel without losing data is a handy time-saver that allows you to consolidate your data and make your sheet look neater.
First and foremost, you should know that there are multiple ways you can merge data from two or more columns in Excel. Before we get started exploring these different ways, let’s start with a key step that helps the process — how to merge cells in Excel.
If you want to combine Google Sheets data, you can do that easily using Layer. Layer is a free add-on that allows you to share sheets or ranges of your main spreadsheet with different people. On top of that, you get to monitor and approve edits and changes made to the shared files before they’re merged back into your master file, giving you more control over your data.
Install the Layer Google Sheets Add-On today and Get Free Access to all the paid features, so you can start managing, automating, and scaling your processes on top of Google Sheets!
How to Combine Multiple Cells or Columns in Excel Without Losing Data?
Once you have merging cells under your belt, learning how to combine multiple Excel columns into one column becomes intuitive.
Whether you’re learning how to combine two cells in Excel, or ten, one of the main benefits of merging is that the formulae don’t change. Here are the following ways you can combine cells or merge columns within your Excel:
Use Ampersand (&) to merge two cells in Excel
If you want to know how to merge two cells in Excel, here’s the quickest and easiest way of doing so without losing any of your data.
- 1. Double-click the cell in which you want to put the combined data and type =
- 2. Click a cell you want to combine, type &, and click the other cell you wish to combine. If you want to include more cells, type &, and click on another cell you wish to merge, etc.
- 3. Press Enter when you have selected all the cells you want to combine
While this is useful for quickly merging data into a single cell, the merged data will not be formatted. This can make data untidy or challenging to read in some instances (e.g. full names or addresses).
If you want to add punctuation or spaces (delimiters), follow the below steps. For this example, let’s put a comma and a space between the first and last name as you would see on a registration list:
- 1. Double-click the cell in which you want to put the merged data and type =
- 2. Click a cell you want to merge
- 3. This time, type &”, ”& before you click the next cell you want to merge. If you want to include more cells, type &”, ”& before clicking the next cell you want to merge, etc.
- 4. Press Enter when you have selected all the cells you want to combine
As you can see, now your merged data comes out in a neater format, with each piece of data appropriately separated.
Use the CONCATENATE function to merge multiple columns in Excel
This method is similar to the ampersand method, and also allows you to format your merged data. First, you need to use the CONCATENATE function to merge a row of cells:
- 1. Insert the =CONCATENATE function as laid out in the instructions above
- 2. Type in the references of the cells you want to combine, separating each reference with ,», «, (e.g. B2,», «,C2,», «,D2). This will create spaces between each value.
- 3. Press Enter
Now that you have successfully merged your cells, you can follow these simple steps to merge multiple columns:
- 1. Hover your mouse over the bottom-right corner of the merged cell you just created
- 2. When the cursor changes into a + symbol, drag your cursor as far down the column as you want and release it
Once you release the mouse, you should see that your merged cell has become a merged column, containing all of the data from your chosen columns.
*The CONCAT function is another formula used for combining data from different cells. However, it is limited to two references and does not allow you to include delimiters.
Use the TEXTJOIN function to merge multiple columns in Excel
This method works only with Excel 365, 2021, and 2019. As you can probably tell, this function is helpful when you want to combine two or more text cells in Excel.
The following steps will show you how to use the TEXTJOIN function, once again using the comma and space combination to create your first merged cell:
- 1. Double-click the cell in which you want to put the combined data
- 2. Type =TEXTJOIN to insert the function
- 3. Type “, ”,TRUE, followed by the references of the cells you want to combine, separating each reference with a comma (the role of TRUE is to disregard empty cells you may have input)
- 4. Press Enter
In order to create the rest of your combined column, use the drag-and-drop steps listed below:
- 1. Hover your mouse over the bottom-right corner of the merged cell you just created
- 2. When the cursor changes into a + symbol, drag your cursor as far down the column as you want and release it.
Now your columns of data have successfully merged into your new column.
The Beginner’s Guide to Excel Version Control
Discover what Excel version control is, the version control features Excel has to offer, and how to use them to share, merge, and review Excel changes
READ MORE
Use the INDEX formula to stack multiple columns into one column in Excel
Let’s say you want to create a stack of data from your multiple columns, rather than create a single cell. You can easily do this across multiple cells and columns within your spreadsheet using the INDEX formula:
- 1. Select all of the cells containing your data
- 2. Type in a name for this group of data in the “Name Box” (box located to the left side of the formula bar). In this example, I’ve named the data “_my_data”
- 3. Select an empty cell in your Excel sheet where you want your stacked data to be located. Input the following INDEX formula (remember to substitute with your data name):
=INDEX(_my_data,1+INT((ROW(A1)-1)/COLUMNS(_my_data)),MOD(ROW(A1)-1+COLUMNS(_my_data),COLUMNS(_my_data))+1)
-
4. The first value from your data range should appear. Hover over the cell until the cursor changes into a + symbol, and drag your cursor as far down until you receive a #REF! value (this signals the end of your data set)
Other ways to combine multiple columns in Excel: Notepad and VBA script
There are two other ways you can combine multiple columns in Excel. These are often more time-consuming, and use other tools as part of the process. However, they may be more helpful for users who wish to avoid using Excel formulae.
Use Notepad to merge multiple columns in Excel
You can use Notepad to extract, format, and replace your data from multiple columns in your Excel. For this, you need to copy and paste each column from your Excel sheet into a Notepad file. Then, use the Replace function to add commas between each value. Once finished, you can copy and paste your formatted data back into your Excel.
Use VBA script to combine two or more columns in Excel
As an alternative to the INDEX function stacking method, you can use VBA script. Simply right-click and select “View code” within your Excel, and copy and paste the code in a new window. Press “F5” to run the code and create a Macro. You can then apply this to your Excel by selecting your data range and applying it to your destination column.
Want to Boost Your Team’s Productivity and Efficiency?
Transform the way your team collaborates with Confluence, a remote-friendly workspace designed to bring knowledge and collaboration together. Say goodbye to scattered information and disjointed communication, and embrace a platform that empowers your team to accomplish more, together.
Key Features and Benefits:
- Centralized Knowledge: Access your team’s collective wisdom with ease.
- Collaborative Workspace: Foster engagement with flexible project tools.
- Seamless Communication: Connect your entire organization effortlessly.
- Preserve Ideas: Capture insights without losing them in chats or notifications.
- Comprehensive Platform: Manage all content in one organized location.
- Open Teamwork: Empower employees to contribute, share, and grow.
- Superior Integrations: Sync with tools like Slack, Jira, Trello, and more.
Limited-Time Offer: Sign up for Confluence today and claim your forever-free plan, revolutionizing your team’s collaboration experience.
Conclusion
As you can see, combining multiple columns is easy in Excel. Whether you’re combing multiple Excel files, or columns and cells, there are a variety of ways that cater to different users, depending on their technical abilities or needs.
As a result, not only can you format your Excel into a cohesive and seamless spreadsheet, but also save time and optimize your productivity when evaluating, managing, or sharing important data. Once you know how to combine multiple columns in Excel into one column, combining or merging your data can become one quick and simple task.
Are you tired of having your data spread out across multiple columns, making it difficult to analyze and understand? It can be overwhelming to have to constantly switch back and forth between columns, hunting for the information you need. This post will show you how to stack data from multiple columns to one column in Microsoft Excel Spreadsheet.
This article will introduce you the two methods. After reading the article below, you will find the two ways are verify simple and convenient to operate in excel.
In previous article, I have shown you the method to split data from one long column to multiple columns by VBA and Index function.
For example, see the initial table below:
And we want reverse data into one column and make it looks like:
Now we can follow below two methods to make it possible. Let’s start it.
Table of Contents
- 1. Stack Data in Multiple Columns into One Column by Formula
- 2. Stack Data in Multiple Columns into One Column by VBA
- 3. Merge Cells into One in Excel
- 4. Combine two columns in excel without losing data
- 5. Combine 2 Columns with a Space
- 6. Append Columns in Excel
- 7. Conclusion
- 8. Related Functions
Step 1: Select range A1 to F2 (you want to do stack), in Name Box, enter a valid name like Range, then click Enter.
Step 2: In any cell you want to locate the first cell of destination column, enter the formula
=INDEX(Range,1+INT((ROW(A1)-1)/COLUMNS(Range)),MOD(ROW(A1)-1+COLUMNS(Range),COLUMNS(Range))+1).
Please be aware that you have to replace ‘Range’ in this formula to your defined name in Name Box.
Step 3: Click Enter. Verify that ‘ID’ (the value in the first cell of selected range) is displayed properly.
Step 4: Drag the fill handle to fill I column. Verify that data in previous initial location is reversed to one column properly.
Note:
If you drag the fill handle to cells extend selected range cell number, error will be displayed in redundant cell.
2. Stack Data in Multiple Columns into One Column by VBA
Step 1: On current visible worksheet, right click on sheet name tab to load Sheet management menu. Select View Code, Microsoft Visual Basic for Applications window pops up.
Or you can enter Microsoft Visual Basic for Applications window via Developer->Visual Basic.
Step 2: In Microsoft Visual Basic for Applications window, click Insert->Module, enter below code in Module1:
Sub StackDataToOneColumn() Dim Rng1 As Range, Rng2 As Range, Rng As Range Dim RowIndex As Integer Set Rng1 = Application.Selection Set Rng1 = Application.InputBox("Select Range:", "StackDataToOneColumn", Rng1.Address, Type:=8) Set Rng2 = Application.InputBox("Destination Column:", "StackDataToOneColumn", Type:=8) RowIndex = 0 Application.ScreenUpdating = False For Each Rng In Rng1.Rows Rng.Copy Rng2.Offset(RowIndex, 0).PasteSpecial Paste:=xlPasteAll, Transpose:=True RowIndex = RowIndex + Rng.Columns.Count Next Application.CutCopyMode = False Application.ScreenUpdating = True End Sub
Step 3: Save the codes, see screenshot below. And then quit Microsoft Visual Basic for Applications.
Step 4: Click Developer->Macros to run Macro. Select ‘StackDataToOneColumn’ and click Run.
Step 5: Stack Data to One Column dialog pops up. Enter Select Range $A$1:$F$2. Click OK. In this step you can select the range you want to do stack.
Step 6: On Stack Data to One Column, enter Destination Column $I$1. Click OK. In this step you can select the first cell from destination range you want to save data.
Step 7: Click OK and check the result. Verify that data is displayed in one column properly. The behavior is as same as the result in method 1 step# 4.
3. Merge Cells into One in Excel
To merge or consolidate cells in Microsoft Excel, follow these steps:
Step 1: Select the cells you want to merge.
Step 2: Right-click on the selected cells and choose “Merge Cells
” from the context menu.
Step 3: Alternatively, you can click on the “Merge & Center
” button in the “Alignment
” section of the “Home
” tab on the ribbon.
4. Combine two columns in excel without losing data
To combine two columns in Microsoft Excel without losing data, you can use the following formula:
Step 1: In a new column C1, enter the following formula:
=A1 & B1
If you want to combine data from two or multiple cells in Excel, you can also use this formula.
Step 2: Press Enter to apply the formula.
Step 3: Drag the formula down to the end of the data in the columns.
The formula uses the & operator to concatenate the contents of two cells. In this example, the formula combines the contents of cells A2 and B2 into a single cell. By dragging the formula down, you can combine the contents of all the cells in the two columns.
You can also use the CONCATENATE function to combine columns, which works in a similar manner. The formula would look like this:
=CONCATENATE(A1, B1).
5. Combine 2 Columns with a Space
If you want to combine two columns with a space between them, you can use the following formula:
=A1 & " " & B1
In this example, the formula combines the contents of cells A1 and B1 into a single cell, separated by a space. By dragging the formula down, you can combine the contents of all the cells in the two columns.
6. Append Columns in Excel
If you want to append two columns in Microsoft Excel, just follow these steps:
Step 1: Select the first column of data that you want to append.
Step 2: Right-click on the selected cells and choose “Copy
” from the context menu.
Step 3: Select the second column of data that you want to append, and right-click on the first cell in the column.
Step 4: Choose “Insert Copied Cells
” from the context menu.
This will insert a copy of the first column of data after the second column, effectively appending the two columns.
7. Conclusion
Stacking data from multiple columns into one is a useful operation in Microsoft Excel when you need to combine and analyze data from different sources. The process can be easily achieved by using the built-in functions such as the & operator or the CONCATENATE function, which allow you to concatenate the contents of multiple cells into one.
Hope you can like this post.
- Excel INDEX function
The Excel INDEX function returns a value from a table based on the index (row number and column number)The INDEX function is a build-in function in Microsoft Excel and it is categorized as a Lookup and Reference Function.The syntax of the INDEX function is as below:= INDEX (array, row_num,[column_num])… - Excel ROW function
The Excel ROW function returns the row number of a cell reference.The ROW function is a build-in function in Microsoft Excel and it is categorized as a Lookup and Reference Function.The syntax of the ROW function is as below:= ROW ([reference])…. - Excel MOD function
he Excel MOD function returns the remainder of two numbers after division. So you can use the MOD function to get the remainder after a number is divided by a divisor in Excel. The syntax of the MOD function is as below:=MOD (number, divisor)…. - Excel INT function
The Excel INT function returns the integer portion of a given number. And it will rounds a given number down to the nearest integer.The syntax of the INT function is as below:= INT (number)… - Excel COLUMNS function
The Excel COLUMNS function returns the number of columns in an Array or a reference.The syntax of the COLUMNS function is as below:=COLUMNS (array)….
Solution 1
Using helper column.
In Cell E2
enter the following formula
=INDEX($A$2:$C$15,MOD(ROW()-ROW($G$2),ROWS($A$2:$A$15))+1,TRUNC((ROW()-ROW($G$2))/ROWS($A$2:$A$15))+1)
Drag/Copy down as required.
Then in Cell F2
enter
=IFERROR(INDEX($E$1:$E$45,SMALL(IF($E$1:$E$45<>0,ROW($E$1:$E$45)),ROW(F1)+1)),"")
This is an array formula so commit by pressing Ctrl+Shift+Enter. Drag/Copy down as required. Change range as required.
See image for reference.
Solution 2
Using ugly looking long formula.
Enter the following formula in Cell D2
=IFERROR(INDEX($A$2:$A$15, SMALL(IF(ISBLANK($A$2:$A$15), "", ROW($A$2:$A$15)-MIN(ROW($A$2:$A$15))+1), ROW(A1))), IFERROR(INDEX($B$2:$B$15, SMALL(IF(ISBLANK($B$2:$B$15), "", ROW($B$2:$B$15)-MIN(ROW($B$2:$B$15))+1), ROW(A1)-SUMPRODUCT(--NOT((ISBLANK($A$2:$A$15)))))), IFERROR(INDEX($C$2:$C$15, SMALL(IF(ISBLANK($C$2:$C$15), "", ROW($C$2:$C$15)-MIN(ROW($C$2:$C$15))+1), ROW(A1)-SUMPRODUCT(--NOT((ISBLANK($A$2:$B$15)))))), "")))
Drag/Copy down as required. Change range as per you data.
Note : This formula will work only for three or less columns.
Say, you have an Excel table and want to copy all column underneath each other so that you only have one column. For example, you have a table 2 rows by 4 columns like in the screenshot on the right-hand side. You want to copy and paste this table to one column. You often need such transformation for inserting PivotTables or to create database formats. This article provides 4 simple methods to transform a 2-dimensional table into one column in Excel.
Example
The following methods will be introduced with a simplified example as shown on the right-hand side. You have a table with numbers within the cell range A1 to G7. That means you have 7 rows and also 7 columns. In total 49 cells to be copied to one column.
Method 1: Copy table to one column manually
Like so often, copying and pasting the columns manually might be the fastest solution. Given that you are reading this article, this might not be the method you want to hear. But anyway, doing it manually is often the fastest way.
Maybe some advice to speed up the manual process might help. Try to use as many keyboard shortcuts as possible. That way you could save some time.
- Holding Ctrl and pressing one of the arrow keys makes you jump between tables and cells.
- Holding the Shift key, you can select cells and ranges.
- And – of course – with Ctrl + C and Ctrl + V you can copy and paste cells.
For more information about the keyboard shortcuts please refer to our big keyboard shortcut package.
Method 2: The INDEX formula
You can convert a two-dimensional table into just one column by using the INDEX formula. Unfortunately, it requires some preparations. But on the other hand, it’s one of the faster ways (compared to setting up the more complex OFFSET formula like in method 3 below or the INDIRECT formula).
Let’s see what you need to prepare. Basically you have to create the column and row number in additional helper columns. That way you can easily refer to the original table. The screenshot on the right-hand side shows the necessary preparations.
- You need one column containing the row number (here in column A). You always start with 1. So if you data start in row 3, the first number you write is still 1.
- You need one column containing the column number (here in column B). Also for the column number you always start with number one.
- The third column contains the actual values, pulled by the formula =INDEX($A$1:$G$7;A10;B10) . Example: In cell C10, the INDEX formula returns the value from the first row and first column of the range A1 to G7.
Please refer to this article for more information about the INDEX formula in Excel.
Method 3: OFFSET formula
The third method uses the OFFSET formula for copying several columns underneath each other to one column. If you need some introduction to the OFFSET formula, please refer to this article.
Because the formula is – in this universal case – very long, we don’t go much into detail here. It’s based on three cells.
- The top left cell of the table you want to convert (here: A1).
- The bottom left cell of the table you want to convert (here: A7).
- The heading cell of your single column, which is supposed to contain all the data from the table (here: A9)
Now you just have to replace the cell links in the following formula with your cells. Don’t forget to fix the references with the $-signs as shown in the formula below.
=OFFSET($A$1,(ROW()-ROW($A$9)-1)-(ROW($A$7)-ROW($A$1)+1)*ROUNDDOWN((ROW()-ROW($A$9)-1)/(ROW($A$7)-ROW($A$1)+1),0),ROUNDDOWN((ROW()-ROW($A$9)-1)/(ROW($A$7)-ROW($A$1)+1),0))
In order to make it easier for you to use the formula, you can use the version below. All you have to do is to give names to the three main cell as shown in the image on the right-hand side. In order to achieve this, select the top left cell of your original table (here: A1) and click into the name field. Type “TopLeftCell” and press Enter on the keyboard. Repeat this with the bottom left cell (name “BottomLeftCell”) as well as the heading cell of your new table (name “HeadingCell”).
Once done, copy and paste the following formula it the first cell (here: A10). Now just copy and paste this cell down until all columns from your original table are covered.
=OFFSET(TopLeftCell,(ROW()-ROW(HeadingCell)-1)-(ROW(BottomLeftCell)-ROW(TopLeftCell)+1)*ROUNDDOWN((ROW()-ROW(HeadingCell)-1)/(ROW(BottomLeftCell)-ROW(TopLeftCell)+1),0),ROUNDDOWN((ROW()-ROW(HeadingCell)-1)/(ROW(BottomLeftCell)-ROW(TopLeftCell)+1),0))
Method 4: Professor Excel Tools
You want to use the most convenient way? Try the Excel add-in “Professor Excel Tools”. The steps are shown in the screenshot below.
- Select the table you want to transform into a single column.
- Click on Copy on the left-hand side of the “Professor Excel”-ribbon.
- Select the first cell from which Professor Excel should paste the columns underneath.
- Click on “Paste to Single Column” on the “Professor Excel” ribbon.
- Now you can finetune the copy-and-paste-format. Do you which to copy the formulas without changing cell references, do you which to copy them as values or do you want to insert links to the original table? Then press Start.
That’s it. Do you want to try “Professor Excel” for free? Then just follow this link for more information or start the download right away.
This function is included in our Excel Add-In ‘Professor Excel Tools’
(No sign-up, download starts directly)
Download
Please feel free to download all examples shown above in one comprehensive Excel file. Just click on this link and the download starts right away.
Combining values with CONCATENATE is the best way, but with this function, it’s not possible to refer to an entire range.
You need to select all the cells of a range one by one, and if you try to refer to an entire range, it will return the text from the first cell.
In this situation, you do need a method where you can refer to an entire range of cells to combine them in a single cell.
So today in this post, I’d like to share with you 5 different ways to combine text from a range into a single cell.
[CONCATENATE + TRANSPOSE] to Combine Values
The best way to combine text from different cells into one cell is by using the transpose function with concatenating function.
Look at the below range of cells where you have a text but every word is in a different cell and you want to get it all in one cell.
Below are the steps you need to follow to combine values from this range of cells into one cell.
- In the B8 (edit the cell using F2), insert the following formula, and do not press enter.
- =CONCATENATE(TRANSPOSE(A1:A5)&” “)
- Now, select the entire inside portion of the concatenate function and press F9. It will convert it into an array.
- After that, remove the curly brackets from the start and the end of the array.
- In the end, hit enter.
That’s all.
How this formula works
In this formula, you have used TRANSPOSE and space in the CONCATENATE. When you convert that reference into hard values it returns an array.
In this array, you have the text from each cell and a space between them and when you hit enter, it combines all of them.
Combine Text using the Fill Justify Option
Fill justify is one of the unused but most powerful tools in Excel. And, whenever you need to combine text from different cells you can use it.
The best thing is, that you need a single click to merge text. Have look at the below data and follow the steps.
- First of all, make sure to increase the width of the column where you have text.
- After that, select all the cells.
- In the end, go to Home Tab ➜ Editing ➜ Fill ➜ Justify.
This will merge text from all the cells into the first cell of the selection.
TEXTJOIN Function for CONCATENATE Values
If you are using Excel 2016 (Office 365), there is a function called “TextJoin”. It can make it easy for you to combine text from different cells into a single cell.
Syntax:
TEXTJOIN(delimiter, ignore_empty, text1, [text2], …)
- delimiter a text string to use as a delimiter.
- ignore_empty true to ignore blank cell, false to not.
- text1 text to combine.
- [text2] text to combine optional.
how to use it
To combine the below list of values you can use the formula:
=TEXTJOIN(" ",TRUE,A1:A5)
Here you have used space as a delimiter, TRUE to ignore blank cells and the entire range in a single argument. In the end, hit enter and you’ll get all the text in a single cell.
Combine Text with Power Query
Power Query is a fantastic tool and I love it. Make sure to check out this (Excel Power Query Tutorial). You can also use it to combine text from a list in a single cell. Below are the steps.
- Select the range of cells and click on “From table” in data tab.
- If will edit your data into Power Query editor.
- Now from here, select the column and go to “Transform Tab”.
- From “Transform” tab, go to Table and click on “Transpose”.
- For this, select all the columns (select first column, press and hold shift key, click on the last column) and press right click and then select “Merge”.
- After that, from Merge window, select space as a separator and name the column.
- In the end, click OK and click on “Close and Load”.
Now you have a new worksheet in your workbook with all the text in a single cell. The best thing about using Power Query is you don’t need to do this setup again and again.
When you update the old list with a new value you need to refresh your query and it will add that new value to the cell.
VBA Code to Combine Values
If you want to use a macro code to combine text from different cells then I have something for you. With this code, you can combine text in no time. All you need to do is, select the range of cells where you have the text and run this code.
Sub combineText()
Dim rng As Range
Dim i As String
For Each rng In Selection
i = i & rng & " "
Next rng
Range("B1").Value = Trim(i)
End Sub
Make sure to specify your desired location in the code where you want to combine the text.
In the end,
There may be different situations for you where you need to concatenate a range of cells into a single cell. And that’s why we have these different methods.
All methods are easy and quick, you need to select the right method as per your need. I must say that give a try to all the methods once and tell me:
Which one is your favorite and worked for you?
Please share your views with me in the comment section. I’d love to hear from you, and please, don’t forget to share this post with your friends, I am sure they will appreciate it.