Suming duplicate values

dmajcan

New Member
Joined
Jan 9, 2017
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hello there.

I've been lurking MrExcel for quite some time, and you guys helped me so much ( unfortunately my excel skills are not good enough to return the favor ). Now I have a problem for which I can't find an answer.

The sheet has approx 4500 rows, with 300-400 values that are duplicated ( some 10, some 15-20 times ), I need to count column D for each value.

I started doing it by hand, sorted sheet by column C and insert a blank row behind each value, and SUM it up ( rows 17 and 27 ) but there must be a faster way to do it.

Thank you in advance for your help

mrexcel-problem2.jpg
 
Last edited by a moderator:

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Hi DMAJcan,

I'm not clear on how you want the results shown or if it's just column C which need to be counted, or if it's actually a SUM of column D you want so take a look at this and see if it helps. It does assume you have sorted all duplicates together.

DMAJcan.xlsx
ABCDEF
1StuffMore StuffKey to COUNT or SUMSum of SomethingResult CountResult Sum
2DogDoggy12318  
3DogDoggy1235  
4DogDoggy1233  
5DogDoggy1238434
6GoatGoaty222212
7SheepSheepy3338  
8SheepSheepy33315223
9CatCatty4567  
10CatCatty45618  
11CatCatty4566  
12CatCatty45612  
13CatCatty4568  
14CatCatty45614  
15CatCatty4566771
16  
Sheet1
Cell Formulas
RangeFormula
E2:E16E2=IF(C2=C3,"",COUNTIF($C$2:$C$5000,C2))
F2:F16F2=IF(C2=C3,"",SUMIF($C$2:$C$5000,C2,$D$2:$D$5000))
 
Upvote 0
It's also not fully clear for me, what you want to count, and how. But here's another way, with Toadstool's setup:

Mappe1
ABCDEF
1StuffMore StuffKey to COUNT or SUMSum of SomethingExtract numbersCount sum
2DogDoggy1233858889290619385888929061914
3DogDoggy123385888929061900
4DogDoggy123385888929061938588892906269
5DogDoggy1233858889290619  
6GoatGoaty2223858889290619  
7SheepSheepy3333858889290619  
8SheepSheepy3333858889290619  
9CatCatty4563858889290619  
10CatCatty4563858889290619  
11CatCatty4563858889290619  
12CatCatty4563858889290619  
13CatCatty4563858889290619  
14CatCatty4563858889290619  
15CatCatty4563858889290619  
16  
173858889290626
183858889290626
193858889290626
203858889290626
213858889290626
223858889290626
233858889290626
243858889290626
253858889290626
Ark1
Cell Formulas
RangeFormula
E2:E16E2=IFERROR(INDEX($D$2:$D$25,MATCH(0,COUNTIF($E$1:E1,$D$2:$D$25),0)),"")
F2:F16F2=IF(E2<>"",COUNTIF($D$2:$D$25,E2),"")
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
ToadStool and ebea, thank you for your replies and sorry for not being clear, I have to count column D for each value.
 
Upvote 0
ToadStool and ebea, thank you for your replies and sorry for not being clear, I have to count column D for each value.
You should could do that, with the Formulas I provided in #3. You just expand the Range in the formula, to your need (4500 rows).
Just remember, that the formula in Red, should be entered with Ctrl+Shift+Enter
 
Upvote 0
You should could do that, with the Formulas I provided in #3. You just expand the Range in the formula, to your need (4500 rows).
Just remember, that the formula in Red, should be entered with Ctrl+Shift+Enter
A little addition to above!

Column E will give you a list of all Unique values in your range.
Column F wil give you the numbers (counts) of these Unique values.

Drag down the Formulas, so long as needed.
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Column F wil give you the numbers (counts) of these Unique values.
Judging from the description & the image it looks as though the OP wants the sum of col D, not the count.
 
Upvote 0
Judging from the description & the image it looks as though the OP wants the sum of col D, not the count.
From answer in #4, it is count (of each Value), not Sum.
 
Upvote 0
As I said from the original post
and SUM it up ( rows 17 and 27 )
and the image clearly shows the sums NOT the counts.
I suspect that post#4 is just a problem with translation
 
Upvote 0

Forum statistics

Threads
1,215,039
Messages
6,122,799
Members
449,095
Latest member
m_smith_solihull

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