Pivot Table Column with Value and Calculated Field row per group? - excel

The more I have to work with Excel in helping our customers with advanced reporting, the more I'm amazed at it's capabilities. That being said, I can't seem to find exactly what this customer wants Excel to do.
Scenario:
We have a datasource which refreshes a worksheet containing many rows and columns of a data export from the customer's database. That worksheet then drives the other tabs' charts, tables, etc.
They want to add a table (pivot) which will take their milestones, sum the (ontime) column, and then take the (rownumber) sum for that area and then divide it so they can see how many projects were on time. Simplified data tab looks like this:
RowNum Area OnTime Milestone
------ ---- ------ ---------
1 North 1 M2
2 East 1 M4
3 East 1 M2
4 North 0 M1
5 East 0 M4
and here's the table they want it to produce.
We can get it to do both using a Sum(value) and calculated field, however we can't get the Sum(value) field to go directly beneath the calculated percentage field. Any ideas?

If I understand correctly, it will be enough to move the Values drawer to your Rows:
If you need to change the order of the values (which one will be at the top etc.), you can do this moving the drawers within Values Window at bottom-right.

Related

excel PowerPivot Auto Calculated Measures & Columns

After looking at a few similarish questions I figured I needed something more specific so asking here. I will start by explaining the situation:
The Setup
I have a Store which sells Cakes, Cookies and Wine. I have the weekly sales data of each product sorta like this:
Product ID
Product Name
Quantity
Value
Week Ending
1
Ginderbread
2
£4
13/01/22
2
Chocolate chip
5
£25
13/01/22
3
Red Wine Bottle
1
£10
13/01/22
4
Sponge Cake
3
£9
13/01/22
Currently every week's data is stored within the same table, with me using a Week filter to show only the week i'm interested in.
Using this Data I created PivotTables that shows the sales of each category, with the ability to drill down to show the specific products. Table looks something like this:
Category
Quantity
Value
Cakes
2
£4
Cookies
7
£29
Wine
1
£10
The issue
I now want to stick in a new calculated column that shows the Value as a %. E.g The total value for the previous table was £43, so Cookies is about 67%. If I drill down, it would show the Chocolate Chip record as 80% and Gingerbread as 20%
I imagine doing this would be easier if each individual week's data was on a different table, but I got a lot of weeks and I also want to do tables showing the sales for over a period of time. Plus I don't know of a way to merge the "value" and "quantity" columns, etc instead of having 1 for each week being shown.
any advice would be appreciated
Create an extra column in the source table (prior to filtering) entitled "perc" calculated as the corresponding value for each row divdied by the total value across all rows (se pic. / eqn. for first row below) --
=E2/$E$6
No calculated fields required - just include perc as the mesaure of interest in your pivot table, with value setting as 'sum':
The reason why this worked is because of the common denominator - which allows one to sum ratios on a 1:1 basis.
Devising a calculated field using the standard 'fields, items & sets' functionality for ordinary pivot tables would not be feasible / possible as far as I am aware. You would need to move into the realm of power pivots and data models - which is not too complicated (readily accesible directly from the field list per below) - however, I see this as unnecessary complication for the task at hand.
Side notes:
Using table names in your functions is sometimes more convenient when entering, albeit may appear tricky at first when reviewing - first eqn above becomes:
=[#Value]/Table1[[#Totals],[Value]]

Top 3 Values for Multiple Categories based on hours in a week

I'm working on a charging matrix where project managers can input time to the top three contracts in each category based on a week to week basis. Right now I have a pivot table with the categories (Production, Spares, Development) with multiple contracts that were charged that week. I manually select the top three from each category and copy into a table where I have formulas creating charge numbers for the project managers to use.
The question is, is there a way I can automate selecting the top 3 contracts from each category based on number of hours for that specific week?
Pivot Table & Charging Matrix
You can use LARGE() to get the top 3 (large(data,1) etc)
Then use index() and match() to get the contract names.
I have made a simple example here, but it will not deal with duplicate results in the hours if they are in the top 3...
There are solutions to that already posted.
If I understand you correctly, you want to automate the process of finding the top 3 contracts under each category and then create the charge number based on the results.
You can do so by creating a new pivot table as demonstrated below, put the Category Name and Contract Name in the Rows field, and put the Hours in the Values field, then right click anywhere within the Row Labels column of the pivot table, go to Filter -> Top 10... -> enter 3 in the second field, then you should have the top three contracts for each category.
P.s. You can choose to sort the hours from largest to smallest, and choose NOT to show the subtotals for each category.
Once you have the list, you can enter your formula (I presume you used a formula) in corresponding cells in column H (as in my example) to create the desired charge number.

Filtering top 10 elements in pivot table does not show expected rows

I am using the excel's pivot table to sort and filter data from Super Store Dataset from tableau . Here is a screen shot of my output.
The steps that I followed are:
a. Put Order Date in the Rows.
b. Put Sub-Category in the Columns.
c. Put the Profit in the Sum of Values.
After that I took these steps:
d. Sort the Grand Total of the Sub Category from largest to smallest.
e. Sort the Grand Total of Order Date from largest to smallest.
f. Filter Top 3 from the Sub-Category.
g. Filter Top 10 from the Order Date.
And the above image of an excel sheet shows my output.
Now the problem is , even though the excel sheet was supposed to show me the top 10 orders , it only manages to show 7 to 8 orders. The rest 2 to 3 of them are either blank or should not even belong to the top 10 category.
Does anybody knows why is this happening. And how can this be prevented.
Thanks.
Edit: This is how the top 15 looks like :
I believe top 10 is based on the vertical Grand Total and it should also be a subset of the top 15.
And this is the top 20 :
It looks like this is caused by opening the .xls workbook in Compatibility Mode. This means that Version 10 pivot tables are created, which have different filtering functionality to the later, Version 12 Pivot Tables.
Change the workbook to an upgraded file format (.xlsx), and refresh your pivot tables - you'll get an interesting message informing you of the changes made to Top 10 filtering, and then the multiple Top N filters will apply correctly:
Here's some more information about Pivot Table versions / compatibility, from Microsoft

excel group data on one page allowing for sorting but also updating (prefer no VBA)

I would like to create a spreadsheet that has 3 types of data (list of students, list of teachers, list of parking), for example:
Students Grade Parking_Lot
Joe A 1
Carl B 2
Teachers Class Parking_Lot
Mr. Bob Science 1
Ms. Ann Math 2
Name Parking_Lot Position
Joe 1 Student
Carl 2 Student
Mr. Bob 1 Teacher
Ms. Ann 2 Teacher
I don't want to enter names more than once. I figured I could edit the students and the teachers table, and create the parking table automatically. But then I can't sort the parking table as the entries are all formulas. I'd like to be able to sort by parking lot or name. I also would like to be able to change parking lot from any of the tables.
Is there any way to accomplish this without VBA? Am I thinking about this wrong?
Thanks,
Nachum
Example with PT (using Count of Name for Σ Values):
Unfortunately referencing the parking lots with just 1 and 2 makes the PT more difficult to interpret.
Added some clarification.
Position, Name and Grade are Row Labels (in that order from the top), Parking Lot and Class are Column Labels, with Count of Name for Σ Values. I chose Type for the Report Filter and removed all Field Subtotals (click on each Field if necessary and select None) and in PivotTable Options, Totals & Filters removed the Grand Totals by unchecking Show grand totals for rows and Show grand totals for columns. Note that the PT is driven by the source data – not vice versa. Changes to the source data will be reflected in the PT (after Refresh) but you can’t edit data cells for fields in the row, column, or page area of the PT.

Excel Pivot Table - Averaging by Category

I'm trying to create an average by category in a pivot table. This is the first time I've created a pivot table so sorry if the answer is staring me in the face. My raw data looks like:
Date, Transaction type, Description, Paid out, Paid in, Balance, Category
Mar-13, Visa, SHOP, £4.44, , £X, Gifts
Mar-13, Visa, SHOP, £5.00, , £Y, Children
Mar-13, Visa, SHOP, £6.00, , £Z, Gifts
Mar-13, Visa, CLOTHES SHOP YORK, £8.00, , £A, Clothing
Mar-13, Visa, FOOD SHOP, £11.96, , £B, Food
My pivot table shows the information rolled up by Month and grouped by a category:
Row Labels Sum of Paid out Sum of Paid in Sum of Difference
2013
Jan £Jan £Jan £C
Food 1 2 -
Car 2 3 -
Cash 6 6
Feb £Feb £Feb £D
Food 1 2
Car 8 0
Cash 2 3
The categories/data is made up in this case, but the desired outcome I'm after is to get an annual average, informing me how much comes in/out on average across the year per category... looking something like:
Row Labels Sum of Paid out Sum of Paid in Sum of Difference
2013
Avg £AvgIn £AvgOut £AvgDiff
Food 1 2 -
Car 5 1.5 -
Cash 4 4.5
Jan £Jan £Jan £C
Food 1 2 -
Car 2 3 -
Cash 6 6
Feb £Feb £Feb £D
Food 1 2
Car 8 0
Cash 2 3
Is this possible to achieve using a pivot table, as I can't seem to find a way to this at the moment using Excel 2010.
Since it appears that your raw data is already grouped by month, you're able to do this pretty easily. You need to re-arrange your data, however -- the months and the categories need to be on different axes. For example, Category as ColumnLabels, with Values then Month as Row Labels. Then right-click one of the normal values for Paid Out, choose "Summarize Value As...", you'll see SUM is currently checked, just change to AVERAGE. Repeat for one of the Paid In values. The labels should change to help let you know if it worked.
Note that this will NOT work effectively if your source data comes in daily, for example. With only one entry per month, the SUM and the AVERAGE of the single entry are identical. This would not be the case if your raw data was daily (and you still grouped by month) -- you'd be switching from a monthly total to a daily average.
I am currently using LibreOffice, which is just the free version of Excel on a mac. It is basically the same thing, but anyways, do you see the top bar where it says =AVERAGE(B8,C8,D8)? Well, that is how you can incorporate the functions within the table. This is actually a pivot table I had to do for my Java class. All you have to do is click on the cell you want to edit, type =, the function name, (in your case, AVERAGE should be fine) and then any other kinds of functions you use. Hope this helps you out.

Resources