The tutorial demonstrates different techniques to quickly merge two cells in Excel and combine multiple cells without losing data in Excel 2016, 2013, 2010 and lower.
In your Excel worksheets, you may often need to merge two or more cells into one large cell. For example, you may want to combine several cells for a better data presentation or structure. In other cases, there may be too much content to be displayed in one cell, and you decide to merge it with adjacent blank cells.
Whatever the reason, combining cells in Excel is not as straightforward as it may seem. If at least two cells you are trying to join contain data, the standard Excel Merge Cells feature will only keep the upper-left cell value and discard values in other cells.
But is there a way to merge cells in Excel without losing data? Of course there is. And further on in this tutorial, you will find a few solutions that work in all versions of Excel 2016, Excel 2013, Excel 2010 and lower.
The fastest and easiest way to combine two or more cells in Excel is to use the built-in Merge and Center option. The whole process takes only 2 quick steps:
In this example, we have a list of fruits in cell A1 and we want to merge it with a couple of empty cells to the right (B2 and C2) to create a large cell that fits the entire list.
Once you click Merge and Center, the selected cells will be combined into one cell and the text is centered like in the following screenshot:
To access a couple more merge options provided by Excel, click the little drop-down arrow next to the Merge & Center button and choose the option you want from the drop-down menu:
Merge Across - combine the selected cells in each row individually:
Merge Cells - join the selected cells into a single cell without centering the text:
When using Excel's built-in features to combine cells, there are a few things to keep in mind:
As already mentioned, the standard Excel merge features keep the content of the top-left cell only. And although Microsoft has made quite a lot of improvements in the recent versions of Excel, the Merge Cells functionality seems to have slipped out of their attention and this critical limitation persists even in Excel 2013 and Excel 2016. Well, where there is no obvious way, there is a workaround :)
This is a quick and easy method of merging cells keeping all their content. However, it requires that all the cells to be merged reside in one area in one column.
If the combined values spread across two or more rows, make the column a bit wider and repeat the process.
This merging technique is easy to use, however it does have a number of limitations:
To be able to merge two or more cells in Excel without losing data and without extra "tricks", we created a special tool - Merge Cells for Excel.
Using this add-in, you can quickly combine multiple cells containing any data types including text, numbers, dates and special symbols. Also, you can separate the values with any delimiter of your choosing such as a comma, space, slash or line break.
To join cells exactly the way you want them, configure the following options:
Apart from joining cells, this tool can quickly merge rows and columns, you just have to select the corresponding option in the "What to merge" drop-down list.
To give the Merge Cells add-in a try, you are welcome to download the evaluation version that works with Excel 2016, 2013, 2010, 2007 and 2003.
Users who feel more comfortable with Excel formulas, may like this way to combine cells in Excel. You can employ the CONCATENATE function or Excel & operator to join the cells' values first, and then merge the cells if needed. The detailed steps follow below.
Supposing you want to combine two cells in your Excel sheet, A2 and B2, and both cells have data in them. Not to lose the value in the second cell during merging, concatenate the two cells by using either of the following formulas:
=CONCATENATE(A2,", ",B2)
=A2&", "&B2
The formula, however, inserts the concatenated values in another cell. If you do need to merge two cells with the original data, A2 and B2 in this example, then a few extra steps are required:
In a similar manner, you can merge multiple cells in Excel, the CONCATENATE formula will be just a little bit longer in this case. An advantage of this approach is that you can separate values with different delimiters within a single formula, for example:
=CONCATENATE(A2, ": ", B2, ", ", C2)
You can find more formula examples in the following tutorial - CONCATENATE in Excel: combine text strings, cells and columns.
If you merge cells in your Excel worksheets on a regular basis, you may find useful the following Merge Cells shortcut.
At first sight, the merge shortcut seems a bit long-winded, but with a little practice you may find this way to combine cells faster than clicking the Merge and Center button with the mouse.
To find merged cells in your Excel sheet, perform the following steps:
If you changed your mind immediately after merging cells, you can quickly unmerge them by pressing the shortcut Ctrl + Z or clicking the Undo button on the Quick Access Toolbar.
To split the previously merged cell, select that cell and click Merge & Center, or click the little arrow next to Merge & Center, and select Unmerge Cells:
After unmerging the cells, the entire contents will appear in the top-left cell.
It goes without saying that merged cells can help present the information in your Excel worksheets in a better and more meaningful way… but they spawn numerous side-effects that you may not be even aware of. Here are just a few examples:
So, my advice would be to think twice before merging cells in Excel and do this only when really needed for presentation or similar purposes, e.g. to center the table title across the table.
If you want to combine cells somewhere in the middle of your Excel sheet, you may consider using the Center Across Selection feature as an alternative:
In terms of look, the result is indistinguishable from the merged cell:
To prove that we did not really merge two cells, we can select each one individually:
This is how you can combine two cells in Excel or merge multiple cells without losing data. Hopefully, this information has proved useful for your day-to-day tasks. I thank you for reading and hope to see on our blog next week.
18 responses to "How to merge cells in Excel without losing data"
Thank you. Useful
Requesting to present VBA Looping
Hi,
I have a one of the columns with sequentially repeated values. I am looking for a shortcut or the easiest way to merge the cells with same values with in the column without impacting any other columns/Rows.
Please let me know if you have any simple ways.
Cheers
Hello Sri,
You can use the macro below to merge values in the first column of the selected range. But please create a backup copy of the book.
Sub MergeSameCells()
Dim sel As Range, sameCells As Range
Dim rowsCount As Integer
Dim priorRowIndex As Integer
Set sel = Application.Selection
rowsCount = sel.Rows.Count
priorRowIndex = 1
Application.DisplayAlerts = False
Set sameCells = sel.Cells(1, 1)
For i = 1 To rowsCount
If sel.Cells(i, 1).Value sel.Cells(priorRowIndex, 1).Value Then
If (sameCells.Rows.Count > 1) Then
sameCells.Merge
End If
Set sameCells = sel.Cells(i, 1)
Else
Set sameCells = Application.Union(sameCells, sel.Cells(i, 1))
End If
priorRowIndex = i
Next
If (sameCells.Rows.Count > 1) Then
sameCells.Merge
End If
Application.DisplayAlerts = True
End Sub
Also, you can use our Duplicate Remover add-in to select duplicates. Then you can delete them. In this case cells will not merged.
https://www.ablebits.com/excel-remove-duplicates/index.php
How to merge cells with two different cells with some cells containing the first, last name and the other cell containing first, last middle initial?
Exp.
Susan, Smith
Susan, Smith A.
Thanks in advance
Hello Susan,
You can take the following macro as a template and modify, if necessary.
Sub MergeSimilarNames()
Dim sel As Range, sameCells As Range
Dim rowsCount As Integer
Dim priorRowIndex As Integer
Set sel = Application.Selection
rowsCount = sel.Rows.Count
priorRowIndex = 1
Application.DisplayAlerts = False
Set sameCells = sel.Cells(1, 1)
For i = 1 To rowsCount
Dim pos1, pos2 As Integer
Dim SimilarNames As Boolean
pos1 = InStr(sel.Cells(i, 1).Value, sel.Cells(priorRowIndex, 1).Value)
pos2 = InStr(sel.Cells(priorRowIndex, 1).Value, sel.Cells(i, 1).Value)
SimilarNames = (pos1 > 0) Or (pos2 > 0)
If Not SimilarNames Then
If (sameCells.Rows.Count > 1) Then
sameCells.Merge
End If
Set sameCells = sel.Cells(i, 1)
Else
Set sameCells = Application.Union(sameCells, sel.Cells(i, 1))
End If
priorRowIndex = i
Next
If (sameCells.Rows.Count > 1) Then
sameCells.Merge
End If
Application.DisplayAlerts = True
End Sub
Hello! ma'm!
i am facing the problem of splitting the data of such type
100.008400,0.125700
99.983900,0.130800
99.910600,0.146100
99.788500,0.171500
99.617700,0.207000
99.398400,0.252400
into two different columns without commas. Is this possible? If yes than how?
Very easy w/o using VBA
Go to Data Tab, then Text to Columns
Keep it on Delimited (click next)
Unclick the default and click the Comma (click next)
This page will show you how it will look (see Data preview). If it looks good then click Finish. If you click "next" you can format the cells if need be (such as number, text, etc).
Hello There,
I have to merge the cells again & again for my business packing list but i don`t know what is the short key of merging cells or if there is no such key then how to set a formula which would merge alternate cells by applying one short key instead of clicking the MERGE & CENTER button with mouse. i have tried aforementioned formula but it is not working after once. can someone help that how it would work continuous?
Stay happy.
Thank you for your help with this.
Hi, I am using an advanced filter on a column of data that contains country headings. Each country takes up three rows of data e.g.
Australia
Australia
Australia
Bahrain
Bahrain
Bahrain
And so on. I want to merge the countries but keep the data in each cell. I know I can use the format painter to do this but this makes further updating of the spreadsheet difficult for users who do not know what I have done. Is there a way I can format the cells to fix this problem?
Further to this, when merged, the data cannot all be sorted alphabetically, so at the moment I have to run a macro to unmerge the cells, sort, and then remerge them using a format painter. If there is a way to avoid using the merge button itself, and achieve the same result that would be perfect.
i have below data in 2 column and i need data same data against Each code in one Cell.
Code Country
1234 America
1234 USA
1234 Pakistan
1234 England
1234 UK
1234 London
5000 Canada
5000 Itlay
5000 UAE
5000 Germany
5464 India
5464 Egypt
5464 Iraq
5464 UK
5464 South Africa
5464 China
5464 Japan
5464 Scotland
1234 ?
5000 ?
5464 ?
I need all countries names in one cell against each code
thanks
Hi,
I want to merge multiple cells based on other cells.of other cells are merged, target cells automatically will merge and sum two values.
For example:
If I merge A1 & A2, then D1 & D2 will merge automatically and will sum C1 & C2.
Please help me.
Hi people
I have a the following work and I need help. I have A column which has several codes "427, 540,etc" random codes like that. Each code has a list of skills associated to it in column B distributed in different cells along several rows on column B. I need to be able to merge all the skills that belongs to one code for example 427 which goes from A:2 to A:20 into one cell in column C without loosing data and then repeat the same process for the rest of the codes in A. so I will have Column A - header : Key Column B Header:Skills Column C: concatenated list of skills by code.
A:2 to A:19 (under the "key" header) I have code 427, for code 427 from B:2 to B:19 I have listed skills, on C:2 I need the listed skills from B:2 to B:19 into that cell (C:2). And repeat the process for "key" 540. Note that the number of cells occupied by skills will differ by each code. Also I need using the code below be able no not having to input myself the cell where I want the merged skills, I want them on the same row that I have the New "key"
I have this code currently
Sub JoinCells()
Set xJoinRange = Application.InputBox(prompt:="Highlight source cells to merge", Type:=8)
xSource = 0
xSource = xJoinRange.Rows.Count
xType = "rows"
If xSource = 1 Then
xSource = xJoinRange.Columns.Count
xType = "columns"
End If
Set xDestination = Application.InputBox(prompt:="Highlight destination cell", Type:=8)
If xType = "rows" Then
temp = xJoinRange.Rows(1).Value
For i = 2 To xSource
temp = temp & " " & xJoinRange.Rows(i).Value
Next i
Else
temp = xJoinRange.Columns(1).Value
For i = 2 To xSource
temp = temp & " " & xJoinRange.Columns(i).Value
Next i
End If
xDestination.Value = temp
End Sub
Thanks!
Trying to merge 2 rows on a Mac Excel 2011 but your software seems to only work for a PC. Do you have a Mac version?
16-1101-EN-S-000-SD-CL2-
0003
convert pdf into excel get value showing in excel in two row i need this two values together with top row if this possible with merge command or any other option is there
Method 3 saved my life!! I loooove this website sooo much! I ad to mere over 5,000 first and last names so THANK YOU!!!
How would i Merge Date and time into one cell without losing value of either, for example:
02/11/2020 09:29
As it currently stands, Date is in Cell A and Time is in Cell B, but i'd like to merge them both into Cell A without losing the data.
Thank you!
Hello!
Date and time are stored in Excel as numbers. Therefore, you can simply sum these cells. Set the cell format "mm/dd/yyyy hh:mm"
I hope my advice will help you solve your task.