How to auto merge duplicate cells in a column?

Pancakey

New Member
Joined
Sep 27, 2023
Messages
22
Office Version
  1. 2021
Platform
  1. Windows
Hello,

I am curious to know if there is a way to auto merge cells with duplicate values within a column?
See below sample data.

NamesValues
Jack65
Arielle44
Arielle44
Tim30
Tim30
Tim30
Mary28
Anna50
Mary28
Mary28
Mary28
Liam68
Liam68
Ken45
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Maybe this:

Book1
ABCDE
1NamesValuesUnique Values
2Jack65Jack65
3Arielle44Arielle44
4Arielle44Tim30
5Tim30Mary28
6Tim30Anna50
7Tim30Mary10
8Mary28Liam68
9Anna50Ken45
10Mary28
11Mary28
12Mary10
13Liam68
14Liam68
15Ken45
Sheet2
Cell Formulas
RangeFormula
D2:E9D2=UNIQUE(A2:B15)
Dynamic array formulas.
 
Upvote 0
Thank you. Would you happen to know if there is an alternative way to do this where I don't have to apply a direct formula to the cell?
 
Upvote 0
I also forgot to ask, is there a way to also count a sum of cells within a column where it will skip counting duplicates values?
 
Upvote 0
Yes, if you go to the Data tab on the ribbon, select your data and use Remove Duplicates. Mind you, this is deleting the duplicate rows.

1701468979410.png
 
Upvote 0
I also forgot to ask, is there a way to also count a sum of cells within a column where it will skip counting duplicates values?
Are you also trying to avoid using a formula here too?
 
Upvote 0
Are you also trying to avoid using a formula here too?
Thank you for confirming! Yes, I would prefer to avoid using a formula if there is an option. However, if there is no option, I can maybe reference the appropriate cells.
 
Upvote 0
Here is a modified version of the first formula I suggested which will sum the unique values in the second column.
Book1
ABCDE
1NamesValuesUnique Values
2Jack65Jack65
3Arielle44Arielle44
4Arielle44Tim30
5Tim30Mary28
6Tim30Anna50
7Tim30Mary10
8Mary28Liam68
9Anna50Ken45
10Mary28
11Mary28
12Mary10
13Liam68
14Liam68
15Ken45
16340
Sheet2
Cell Formulas
RangeFormula
D2:E9D2=UNIQUE(A2:B15)
B16B16=SUM(TAKE(UNIQUE(A2:B15),,2))
Dynamic array formulas.



Thank you for confirming! Yes, I would prefer to avoid using a formula if there is an option. However, if there is no option, I can maybe reference the appropriate cells.

Where would you want the total to be displayed then?
 
Upvote 0
Here is a modified version of the first formula I suggested which will sum the unique values in the second column.
Book1
ABCDE
1NamesValuesUnique Values
2Jack65Jack65
3Arielle44Arielle44
4Arielle44Tim30
5Tim30Mary28
6Tim30Anna50
7Tim30Mary10
8Mary28Liam68
9Anna50Ken45
10Mary28
11Mary28
12Mary10
13Liam68
14Liam68
15Ken45
16340
Sheet2
Cell Formulas
RangeFormula
D2:E9D2=UNIQUE(A2:B15)
B16B16=SUM(TAKE(UNIQUE(A2:B15),,2))
Dynamic array formulas.





Where would you want the total to be displayed then?
So I am hoping to have the duplicate values merged within the same cells where the data are, and I am trying to see if there is a way without using a formula.

Regarding the sum formula for the unique values. If you don't mind, are you able to explain what the number "2" means in the formula?
=SUM(TAKE(UNIQUE(A2:B15),,2))
 
Upvote 0
TAKE
Office 365 button
Lookup and reference: Returns a specified number of contiguous rows or columns from the start or end of an array

After rereading the description myself, the 2 should be a -1 indicating the last column in the array (1 would be the first column). So in this case, it is using only column B with the values. The 2 would be taking both columns A and B, which still manage to return the correct sum, but I would change it to -1 anyway.
 
Upvote 0

Forum statistics

Threads
1,215,155
Messages
6,123,335
Members
449,098
Latest member
thnirmitha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top