Sum/Merge only certain duplicates.

wAtcHer1

New Member
Joined
Dec 5, 2014
Messages
8
I apologize if I am not wording this correctly. I am new to this. I am hoping for a VBA that can solve this issue. Currently I am not using one. I normally find VBA’s online to use, I do not write them myself. The system we have at work is Microsoft 365 and we are still running Windows 10 Pro. I have a column/row with duplicate identifiers (SKU) and another column with pricing (EACH). I need to merge the duplicate identifiers that only have the same pricing and leave the duplicate with different pricing in place. My system will not let me download XL2BB so can only provide an image.
 

Attachments

  • 20230517_083738.jpg
    20230517_083738.jpg
    244 KB · Views: 17

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Welcome to Mr. Excel,

You'll have better success with help if you post your sample sheet and expected result(s) using XL2BB. Otherwise, anyone trying to assist has to retype and recreate your example.
 
Upvote 0
Welcome to Mr. Excel,

You'll have better success with help if you post your sample sheet and expected result(s) using XL2BB. Otherwise, anyone trying to assist has to retype and recreate your example.
Thank you for you response. I will try again to download XL2BB. The system at work is locked. It would not let me download. Will attempt a work around.
 
Upvote 0
Use Dropbox.Com or Box.Net and provide the link to that file.
 
Upvote 0
Here is a Power Query Solution

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"WORK FORMS", "SKU", "EACH"}, {{"Total QTY", each List.Sum([QTY]), type number}, {"Total Cost", each List.Sum([COST]), type number}})
in
    #"Grouped Rows"

Sum Spreadsheet.xlsm
ABCDE
1WORK FORMSSKUQTYEACHCOST
215-24" Tinsel Work Wreath Form: Burlap XX7504W42$5.75$11.50
315-24" Tinsel Work Wreath Form: Burlap XX7504W42$5.75$11.50
415-24" Tinsel Work Wreath Form: Burlap XX7504W41$5.75$5.75
515-24" Tinsel Work Wreath Form: Burlap XX7504W43$5.75$17.25
615-24" Tinsel Work Wreath Form: Burlap XX7504W44$6.75$27.00
715-24" Tinsel Work Wreath Form: Lime XX7504371$5.75$5.75
815-24" Tinsel Work Wreath Form: Lime XX7504372$5.75$11.50
915-24" Tinsel Work Wreath Form: Lime XX7504371$5.75$5.75
1015-24" Tinsel Work Wreath Form: Lime XX7504373$5.75$17.25
1115-24" Tinsel Work Wreath Form: Lime XX7504373$6.75$20.25
12
13
14WORK FORMSSKUEACHTotal QTYTotal Cost
1515-24" Tinsel Work Wreath Form: Burlap XX7504W45.75846
1615-24" Tinsel Work Wreath Form: Burlap XX7504W46.75427
1715-24" Tinsel Work Wreath Form: Lime XX7504375.75740.25
1815-24" Tinsel Work Wreath Form: Lime XX7504376.75320.25
Sheet1
Cell Formulas
RangeFormula
E2:E11E2=SUM(C2*D2)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B1Cell ValueduplicatestextNO
B2:B6Cell ValueduplicatestextNO
B7:B12Cell ValueduplicatestextNO
 
Upvote 0
I have never worked in Power Query so am going to spend some time figuring out how to do this. Certainly looks like it will do what I want. Thank you.
 
Upvote 0
Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

- Follow this link to learn how to install Power Query in Excel 2010 / 2013.

- Follow this link for an introduction to Power Query functionality.

- Follow this link for a video which demonstrates how to use Power Query code provided.
 
Upvote 0
Here's a non-vba approach if you don't mind having to rearrange one of the columns (which could be done via VBA).

Sum Spreadsheet.xlsm
ABCDEFGHIJK
1WORK FORMSSKUQTYEACHCOST
215-24" Tinsel Work Wreath Form: Burlap XX7504W42$5.75$11.5015-24" Tinsel Work Wreath Form: Burlap XX7504W4$5.758$46.00
315-24" Tinsel Work Wreath Form: Burlap XX7504W42$5.75$11.5015-24" Tinsel Work Wreath Form: Burlap XX7504W4$6.754$27.00
415-24" Tinsel Work Wreath Form: Burlap XX7504W41$5.75$5.7515-24" Tinsel Work Wreath Form: Lime XX750437$5.757$40.25
515-24" Tinsel Work Wreath Form: Burlap XX7504W43$5.75$17.2515-24" Tinsel Work Wreath Form: Lime XX750437$6.753$20.25
615-24" Tinsel Work Wreath Form: Burlap XX7504W44$6.75$27.00
715-24" Tinsel Work Wreath Form: Lime XX7504371$5.75$5.75
815-24" Tinsel Work Wreath Form: Lime XX7504372$5.75$11.50
915-24" Tinsel Work Wreath Form: Lime XX7504371$5.75$5.75
1015-24" Tinsel Work Wreath Form: Lime XX7504373$5.75$17.25
1115-24" Tinsel Work Wreath Form: Lime XX7504373$6.75$20.25
Sheet1
Cell Formulas
RangeFormula
H2:I5H2=UNIQUE(CHOOSE({1,2},B2:B11,D2:D11))
J2:J5J2=SUMIFS($C$2:$C$11,$B$2:$B$11,$H2,$D$2:$D$11,$I2)
K2:K5,E2:E11K2=I2*J2
G2:G5G2=XLOOKUP(H2,$B$2:$B$11,$A$2:$A$11)
Dynamic array formulas.
 
Upvote 0
Thank you both, I am going to try the formula. However, I still would like to learn more about Power Query.
 
Upvote 0

Forum statistics

Threads
1,216,466
Messages
6,130,795
Members
449,593
Latest member
morpheous

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