Sum Unique & Duplicate Rows Only Once

gryce

New Member
Joined
Nov 15, 2017
Messages
7
Hi everyone,

I've got a spreadsheet with thousands of rows of data. We have duplicated some rows of data to make it easier for another group to read through the file. I need to sum up the totals in column B, but I only want to sum unique values and only the first duplicate row from column A.


ColAColBDesired Sum
AA22
AA2
BB33
CC22
DD55
DD5
EE11
FF44
FF4
17

<tbody>
</tbody>

As you can see, Column A has 3 duplicates, and in my third column I'm showing how I'd like to count them (only the first occurrance; they'll always be the same value in column B).

I need to sum the values of column B, but only when column A is either unique, or the first in a series of duplicates.

Thanks for the attention

Brandon
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
This is an array formula that must be entered with CTRL-SHIFT-ENTER.
Drag formula down as needed.
Excel Workbook
ABC
1ColAColBDesired Sum
2AA22
3AA2
4BB33
5CC22
6DD55
7DD5
8EE11
9FF44
10FF4
1117
Sheet
 
Upvote 0
Barry's formula is much better than mine (I made it way to complicated).
 
Upvote 0
Everyone,

Thanks so much for the responses! This is close, but I believe I've confused matters by adding that virtual column C. In reality there is a distinction and I'll try to illustrate it below. Column C doesn't exist, I'm actually summarizing column B on another worksheet. Additionally in this example I grouped all of my items together for readability, but in fact the duplicates may be mingled throughout the document, and there can be more than one duplication (in some cases 16 duplicates).

ColAColB
AA2
CC10
AA2
BB13
EE5
BB13
GG1
FF2
FF2
FF2
FF2
JJ4
II8
AA2

<tbody>
</tbody>
 
Upvote 0
Ok, assuming data down to row 100 you can use this formula to get a single total, first row value of each repeated text value

=SUM(IF(A2:A100<>"",IF(MATCH(A2:A100,A2:A100,0)=ROW(A2:A100)-ROW(A2)+1,B2:B100)))

confirm with CTRL+SHIFT+ENTER
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,737
Messages
6,126,557
Members
449,318
Latest member
Son Raphon

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