Multiple criteria Sum, Merge & Delete Rows

arnorian

New Member
Joined
Aug 26, 2013
Messages
19
Hi Everyone,

I am not sure what is the best way of solving this problem whether its some advanced function, or VBA/Macro route.

What I am trying to accomplish is to merge and sum multiple rows for the same invoice number. So, if for INV1 there's multiple product line with same product line name (i.e. TIre) then should Sum Column E for those product lines and delete rest of duplicate rows. Then check rest of product lines under Product Line for INV1 and see there's no multiple product line (ie Camera) then keep as is. then move on to the next invoice

Column A
Invoice
Column B
Product Line
Column C
Random
Column D
Date
Column E
Amount
INV1Tire103/01/15$226.10
INV1Tire103/01/15$170.00
INV1Tire103/01/15$676.83
INV1Camera203/01/15$519.75
INV2Installation103/01/15$693.00
INV2Installation103/01/15$1,107.54
INV2BLR203/01/15$1,062.60
INV2Traffic103/01/15$984.69


<colgroup><col width="158" span="5" style="width: 119pt;"></colgroup><tbody>
</tbody>


Where the final sheet should look something like this after all analysis:


Column A
Invoice
Column B
Product Line
Column C
Random
Column D
Date
Column E
Amount
INV1Tire103/01/15$972.93
INV1Camera203/01/15$519.75
INV2Installation103/01/15$1800.54
INV2BLR203/01/15$1,062.60
INV2Traffic103/01/15$984.69

<colgroup><col width="158" span="5" style="width: 119pt;"></colgroup><tbody>
</tbody>



Thank you
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hello arnorian,

I think, when you need to sumarize data, pivot table is the simplest solution. From your data, I created pivot table that looks like this:

Invoice
Product Line
Random
Date
Sum of Amount
INV1
Camera
2
3.1.2015
$ 519,75
INV1
Tire
1
3.1.2015
$1.072,93
INV2
BLR
2
3.1.2015
$1.062,60
INV2
Installation
1
3.1.2015
$1.800,54
INV2
Traffic
1
3.1.2015
$984,69
Grand Total
$5.440,51

<tbody>
</tbody>
 
Upvote 0
Hi Mr_Olaf,

I have tried Pivot table first actually. Problem with Pivot is there are dozens of product line categories which makes Pivot hard to read and summarize. Additionally, when I'm analyzing data by customer/invoice for other calculations it would be very difficult. I think some sort of VBA or Macro code would be necesary.
 
Upvote 0
Hi Mr_Olaf,

I have tried Pivot table first actually. Problem with Pivot is there are dozens of product line categories which makes Pivot hard to read and summarize. Additionally, when I'm analyzing data by customer/invoice for other calculations it would be very difficult. I think some sort of VBA or Macro code would be necesary.

I'm with the Olaf, use a Pivot Table. Your difficulty with Pivot Table may be in understanding the multitude of formatting options you have. Plus the various ways of applying Filters to get just the data you are looking for. Slicers are another method of filtering pivot tables, just more graphical.
You can easily switch from a customer centric Pivot Table to a product centric table and include Quantities and separate dollar summations. Subtotals can be included or omitted at any level. Then you could throw those summaries into a chart too.
 
Upvote 0
Have you tried to reduce output data from Pivot table by adding report filters and slicers. You can make many pivot tabels from the same pivot cahe and create different results from the same data. Refreshing pivot cache will refresh all pivot tables. Macro can help you not to doing it manualy.
Any kind of VBA solution can' t be more clear then results obtained from Pivot table, because you can make them as simple, as you need.
Maybe if you can give me more examples what you would like to get from dour data.
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,692
Members
449,117
Latest member
Aaagu

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