Excel pivot table exclude some column totals - excel

I am using an Excel 2010 pivot table to display data. I need the sub totals in most columns but some columns display percentages and totaling the percentages is not correct and displays confusing values. Is there any way I can choose which columns not to total.

It's hard to make sure I'm accurately addressing your question without more detail about your data, but I will provide a simple example.
Recommendation
I would suggest that you put all measures/values in the Values area of the Pivot Table, and not in the Row Labels. That way, you will not get Row sub-totals for values.
In order to address the non-additive totals and sub-totals for your percentages, I recommend that you remove the pre-calculated percentages from your Pivot Table Values and instead use a Calculated Field that is calculated within the Pivot Table itself from the base data, and will provide correct aggregate totals and sub-totals.
Example
See below:
Method
In order to create a Calculated Field using the Ribbon, select your Pivot Table, and then go to PivotTable Tools --> Options --> Fields, Items, & Sets --> Calculated Field.
Then, enter a name for the new Field (CalcPercentSoldUnits in my example below), as well as the formula definition for the field ( =UnitsSold /UnitsProduced in my example below). Click 'Add' to create the field and then 'OK' to exit the dialog box.
Now you have created a derived field not in your base data table, but in your Pivot Table, which can be used just like a normal field. You can also see that it will calculate totals and sub-totals correctly because instead of adding constants, it is calculating based on the sums of other constants from which the percentages are derived.
In some cases depending on how your data is structured, you may need to create a Calculated Item instead of a Calculated Field.
I hope this helps - if this doesn't address your situation, please post additional examples of your data and desired results. Thanks!

I have the same problem. Some Columns should be totaled, and others should not be. The only thing I figured out is to Grand Total all columns, then format those cells in the Grand total so that the font color matches the background color. This hides those selected Grand Totals from being viewed and/or printed. I experimented by expanding the Pivot Table rows, and the formatting for the selected cells followed into the new cell(s) and when I removed some of the rows, the formatting followed as well.

Wherever you don't want to show the total columns simply hide the column in the total section. I couldn't find any other way to do it.

Be careful about things like distinct/unique counts. This method helps with percentages, but you don't want to sum or average or otherwise aggregate unique counts. I would prefer to be able to just exclude a total for a single field but haven't found a method to do so.

I think I have a similar situation and a great answer for presentation purposes. I'm billing a customer for unbilled items; my pivot shows Qty, rate, and total missed revenue (qty*rate) for each month. Having a sum of Qty and Revenue makes sense for each month, but totaling the rates of the items doesn't. Pivot table and value options are an all-or-none solution. Rather, I just selected the totals I needed to hide and formatted them with white font color (blue for the grand total). My pivot table looks great now with this band-aid approach.

Related

SubTotal - unable to get the correct value for the fields where avg out the vlaue

I need your help on the below two points:
1) When I subtotal the value based on the allocation key, the fields where i have used avg() to sum up the percentage is not summing up correctly.
2) How can i provide the different color coding for the sub total row and the header in the report.
Please refer the snippet for your easy reference.
Thanks in advance
enter image description here
Coding:-
Avg(If([Qtr]="Q1",[percentage])) as [Q1 %],
Sum(If([Qtr]="Q1",[Total Value $])) as [Q1],
Avg(If([Qtr]="Q2",[percentage])) as [Q2 %],
Sum(If([Qtr]="Q2",[Total Value $])) as [Q2],
There has been an update since 7.11 to allow the user to toggle between calculating values on the underlying data or whats shown in the cell values of the pivot table.
It is now possible to configure the cross table to calculate subtotals
and grand totals based on the aggregated values visualized in the
table, as an option to calculating it using the underlying row level
data. This is useful, for example, when you want to visualize the sum
of the absolute values of the categories displayed in the table:
As far as I know, you cannot do color customization to the Sub or Grand Total rows. You can edit the appearance of the Header row by View > Visual Theme > Edit Custom Theme and modifying the Details Tab. You can also pull in a template from one of the Spotfire Sample Reports that already do it if you want.
https://community.tibco.com/wiki/whats-new-tibco-spotfire?
The 6.5.3 User's Guide says this regarding the first question:
Note: The aggregated value for subtotals is not calculated on the
values shown in the cross table, but on the underlying row values. For
example, if "Average" is used as aggregation measure, the subtotal
average of a column is calculated on the rows the column is based on
and not on the values shown in the cross table.
I believe that "subtotal average" means the average of the rows involved in the calculation. I don't see any way to customize the way that subtotals are calculated.
For your second question, I don't believe that there's a way to do that, unfortunately.

Excel Pivot Table Cumulative Change

Basically, I have a set of data, with the following columns: date, price, daily price change and % change, the former two calculated using pivot table field list menu. I want to calculate the cumulative daily change over the period of time, in a next column. As it is a pivot table, it has absolute references and I cannot simply add previous day's change to a today's change one by one, due to a large data set. What is the most efficient way to do it? Thank you.
Go to pivot table option tab which appears when you select any cell in the pivot table range. The click on the drop down menu Option and deselect Generate GetPivotData.
After this, you can use the formulas as normal.
You can add additional column in the main sheet as "cumulative change". The new column can have the cumulative value and you can use summation formula for this.
Then you can take this value in pivot table for further analysis.
Take the help of Vlookup also.
You can follow the steps in the video below for detail pivot analysis as per your need.
https://www.youtube.com/watch?v=vzd7RUGloXM
https://www.youtube.com/watch?v=wsCxOmsMq6k

How do I create a custom grand total or calculated field in my pivot table in Excel?

I have a pivot table with various calculated fields. I want one of these calculated fields to change depending on what I choose from the slicer. In order to help understand what I'm trying to do I can provide some screenshots:
Here each row contains information for one SITA and each column is a calculated field. The Var(%) column is (ABS(OTB Occupancy - OFF Occupancy))/OTB Occupancy. The very last entry in Var(%) is calculated manually and takes the average of the column (this restricts me from filtering the pivot table as I'll have to recalculate the formula and/or move it to another cell so it stays in the position where it is the last cell).
Now my problem is I am no longer using this pivot table but I am starting to create other pivot tables which need to be more dynamic than this one. For example:
As you can see the first two entries of April in the pivot table correspond with the previous pivot table (OTB Occupancy and OFF Occupancy are the same as Sum of Act_Occ and Sum of Fct_Occ respectively). However, I need the third column to be the average given in the last entry of Var(%). (Please note that this cell isn't part of the pivot table and it's just a formula i used). But also, if I were to select two SITAs only from the slicer I'll want only the average of them two.
I'm not sure if excel can do what I want but any help is appreciated.

How to show less than a specific percentage in an Excel pivot table?

I have a pivot table made in Excel and I already have all the % collected data there.
Now, what I need to do is show only the critical ones which are less than 85%, as I don't need anything above that being shown.
Is there a way I can show less than 85% or any other amount in the future?
Add another column to your raw data. Set formula to [assuming the % is in column A]:
=A1<85%
Add this column to your pivot table as a filter. Filter for where your new column = TRUE.
Edit for new info
Per your comments below, the %'s are not actually calculated "within" the pivot table, they are next to the pivot table on the same tab. So, simply add an "if" statement to that formula, like so:
= if(('Total Paid'+'Total Contr. Adj.')/('Total Billed Amount'-'Other Adj.'-'Write-Off')<85%,('Total Paid'+'Total Contr. Adj.')/('Total Billed Amount'-'Other Adj.'-'Write-Off'),"")
This will check to see if your formula is <85%. If it is, the formula will appear there.

Use formula in custom calculated field in Pivot Table

In Excel Pivot table report there is possibility for user intervention by inserting "Calculated Field" so that user can further manipulate the report. This seems like best approach compared to using formula on Pivot table data, outside the Pivot table, for many obvious reasons.
"Calculated Field" dialog, looks like this:
and while it's easy to do calculation between available variables (as shown in screenshot) I can't find how to reference range of values for any of available variables.
For example, if for some reason I want to center the data in range A1:A100 I'd use = A1 - AVERAGE(A1:A100) and fill all rows in regular Excel table. But for Pivot table, if I use "Calculated Field" dialog and add new variable with formula: = 'Actual Sales' - AVERAGE('Actual Sales') I get 0 as output.
So my question is how can I reference whole range for 'Actual Sales' variable in "Calculated Field" dialog, so that AVERAGE() will return the average of all targeted cells ?
I'll post this comment as answer, as I'm confident enough that what I asked is not possible.
I) Couple of similar questions trying to do the same, without success:
Pivot Calculated formula: SUM(Field1)/AVG(Field2)
Excel Pivot Table Calculated Field
II) This article: Excel Pivot Table Calculated Field for example lists many restrictions of Calculated Field:
For calculated fields, the individual amounts in the other fields are summed, and then the calculation is performed on the total amount.
Calculated field formulas cannot refer to the pivot table totals or subtotals
Calculated field formulas cannot refer to worksheet cells by address or by name.
Sum is the only function available for a calculated field.
Calculated fields are not available in an OLAP-based pivot table.
III) There is tiny limited possibility to use AVERAGE() and similar function for a range of cells, but that applies only if Pivot table doesn't have grouped cells, which allows listing the cells as items in new group (right to "Fileds" listbox in above screenshot) and then user can calculate AVERAGE(), referencing explicitly every item (cell), from Items listbox, as argument. Maybe it's better explained here: Calculate values in a PivotTable report
For my Pivot table it wasn't applicable because my range wasn't small enough, this option to be sane choice.
Some of it is possible, specifically accessing subtotals:
"In Excel 2010+, you can right-click on the values and select Show Values As –> % of Parent Row Total." (or % of Parent Column Total)
And make sure the field in question is a number field that can be summed, it does not work for text fields for which only count is normally informative.
Source: http://datapigtechnologies.com/blog/index.php/excel-2010-pivottable-subtotals/
Thank you for planting a seed, Cel! I've been struggling with this for hours, finally got it. I was counting a text field, oops, calculation failed.
Created 2 helper columns in my raw data, each resulting in 1 if condition met, 0 if not. Then pulled each into a pivot column, mine are called, "Inbd" (for Inbound), "Back", where "Back" is a return to sending facility, so in reality the total is one trip, not 2 trips, i.e., back is a subset of inbound and not every inbd has a back (obviously). Trying to calculate in the pivot table so I can sort on the field the rate of back to inbound for each sending facility.
For my calculated field I used: =IFERROR(IF(Pvt_Back>0,Pvt_Back/Pvt_Inbd,0),0)
So: if we sent back to sending some number of times greater than 0, divide Back/Inbd to give me a rate; if equal to 0, then 0; if Inbd = 0, then 0 to avoid Div/0 error.
Thanks again!! :)
Pivot table Excel2007- average to exclude zeros
=sum(XX:XX)/count if(XX:XX, ">0")
Invoice USD
Qty Rate(count) Value (sum)
300 0.000 000.000
1000 0.385 385.000
Average Rate Count should Exclude 0.000 rate

Resources