If Column A has duplicates then add the value in column D for the duplicates

EquipmentPartsSales

New Member
Joined
Sep 17, 2018
Messages
6
I have a large inventory file I am working with. The data looks like this:
NSNPart numberConditionQTYDESC
100500195089711662739NS7MOTOR
100500195089711662739NS2MOTOR
1005002676740368506201NS4HOUSING
10050050132015013201NS1SPRING

<tbody>
</tbody>

Basically what I would like to do is if the number in column NSN has a duplicate then add up the values in the QTY column. For this example it would like like this:
NSNPart numberConditionQTYDESCTotal Qty
100500195089711662739NS7MOTOR9
100500195089711662739NS2MOTOR
1005002676740368506201NS4HOUSING
10050050132015013201NS1SPRING

<tbody>
</tbody>

I do not know if there is a simple formula or a VBA code that will achieve this. My inventory list has roughly 200,000 lines. Any help would be greatly appreciated.
 
Another way to copy a formula down, is select the cell with the formula & double click on the little ∎ in the bottom right of the cell. This will fill down to the last used cell in the column to the immediate right.
 
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Yes, if you don't have any blank rows in between your data, Fluff's suggestion is the quickest way.
 
Upvote 0
No, not sounding rude at all, I just didn't know who you were talking to, and still don't know if my formula is working for you.

The other formula offered above Only does a COUNT of Column A, whereas, according to your description you want a SUM of Column D (Qty) for Duplicates in Column A, but ignore the unique NSN(s) in Column A (as my formula does).

Anyway, using my table in Post # 3 as sample, to quickly copy F2 formula All the Way to F200000:

1. Select F2, Right click, Copy
2. Hit F5, inside the "Reference" box, type F3:F200000
3. Hold down Shift, Click "OK"
4. Control V, the formula is now copied All the way down to F200000


Thank you for all the info I had to to use a VBA module in order to make it work. I am saving your countif formula for other uses. Thanks again.
 
Upvote 0

Forum statistics

Threads
1,215,594
Messages
6,125,723
Members
449,255
Latest member
whatdoido

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