Solved

How can I show a summary of part number and the shipped amounts as a summary in Excel?

Posted on 2014-10-24
5
162 Views
Last Modified: 2014-10-24
Here is a sample of the source data in Excel.

PROD CODE      SHIP QTY
00001                        0.00
00001                        90.00
00001                        0.00
00002                        0.00
00003                        0.00
00003                        5.00
00003                        -5.00
00004                        0.00
00005                        0.00
00006                       58.00
etc...

I would like a macro or script which would open the Excel file, and show only the Total Shipped by Product.
Where there is a negative, is that should be deducted from the total amount for that particular Product.

The desired output would be something like this:

PROD CODE      SHIP QTY
00001                        90.00
00002                        90.00
00003                        0.00
00004                        0.00
00005                        0.00
00006                       58.00
etc...
0
Comment
Question by:100questions
  • 3
5 Comments
 
LVL 27

Accepted Solution

by:
Glenn Ray earned 500 total points
ID: 40402528
PivotTables!

Almost anytime you think "summarize", PivotTables are the solution.  

Just click any cell in your data, then select Menu: Insert tab, Tables section, PivotTable.  You'll see a dialog box and your entire data section will be selected (you'll see a marquee around it).  Click the "OK" button.

In your example, you'll then make "PROD CODE" a Row Label (click and drag it from the "Choose fields to add to report" to the "Row Labels" section.  Then make "SHIP QTY" a Value (click and drag it to the "Values" section).
pivot table example
See the example workbook with some additional data.


Regards,
-Glenn
EE-PTexample.xlsx
0
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 40402688
A PivotTable is definitely the best way to do this.  But don't just take Glenn's and my word for it:

https://www.youtube.com/watch?v=GwbSJFtRmDw

:)
0
 

Author Comment

by:100questions
ID: 40402701
Thanks however in my list it's not calculating correctly at all.
The Sum of the Ship Qty is no where that it should be close to.
Something is not working correctly.
0
 

Author Comment

by:100questions
ID: 40402710
I changed the summary to Sum instead of Count and it seems to work fine.
0
 

Author Closing Comment

by:100questions
ID: 40402711
Works very well, thank you.
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question