Eliminate duplicate entries but keep running total?

9tanstaafl9

Well-known Member
Joined
Mar 23, 2008
Messages
535
Basically I have a simple set of data sorted by cost code (col B). Each cost code has an amount (col C). There may be one or more of each cost code.

When all is said and done, what I want is to see only one of each cost code. If more than one had originally existed, I want the total to be the sum of all of them. NO EXTRA ROWS.

I can't for the life of me figure out how to do this. I know there is probably a simple way, but the search terms are too general and I get info on creating subtotals that doesn't help.

If anyone could help me, or point me in the right direction I would appreciate it immensely. I can figure things out if you tell me where to look, my issue is that I have no idea where to look.

Thanks!!!!!!!
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hi,

How automatic does it need to be?

For instance, you can make a copy of the original data;
Copy it to another sheet;
Remove duplicates (Tab: Data, Section: Data Tools, Remove Duplicates)
Then use the data on both sheets to get the totals.


Excel 2013
BC
1cost codecost
21151
31173
41117
52195
62180
72169
83190
93122
104180
115160
126187
137138
147135
158133
169156
179119
Sheet1



Excel 2013
BCD
1cost codecosttotal
21151441
32195544
43190312
54180180
65160160
76187187
87138273
98133133
109156275
Sheet2
Cell Formulas
RangeFormula
D2=SUMIF(Sheet1!$B$2:$B$17,Sheet2!B2,Sheet1!$C$2:$C$17)
D3=SUMIF(Sheet1!$B$2:$B$17,Sheet2!B3,Sheet1!$C$2:$C$17)
D4=SUMIF(Sheet1!$B$2:$B$17,Sheet2!B4,Sheet1!$C$2:$C$17)
D5=SUMIF(Sheet1!$B$2:$B$17,Sheet2!B5,Sheet1!$C$2:$C$17)
D6=SUMIF(Sheet1!$B$2:$B$17,Sheet2!B6,Sheet1!$C$2:$C$17)
D7=SUMIF(Sheet1!$B$2:$B$17,Sheet2!B7,Sheet1!$C$2:$C$17)
D8=SUMIF(Sheet1!$B$2:$B$17,Sheet2!B8,Sheet1!$C$2:$C$17)
D9=SUMIF(Sheet1!$B$2:$B$17,Sheet2!B9,Sheet1!$C$2:$C$17)
D10=SUMIF(Sheet1!$B$2:$B$17,Sheet2!B10,Sheet1!$C$2:$C$17)
 
Upvote 0
THANK YOU! I knew there must be an easy way to do this, I just couldn't think clearly. Also, I didn't know there was a remove duplicates command. Not sure how I missed that, but it just never came up before.

I really appreciate your help!
 
Upvote 0
Or you could create a pivottable from the original data using the cost codes as row headers.
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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