How can I create a % variance column in Excel 2010 pivot table? - excel

I have a Pivot table containing sales data.
In the Rows I have sales country, in the Columns I have sales date (year) and I have the sum of the invoiced net values in the data section.
Across the top I have two columns - '2012' and '2013' - next to these excel, by default adds a grand total column adding the two years together.
Is there anyway that, instead of a grand total, I can show the percentage variance between 2012 and 2013?

Excel 2010 may be different but if Excel 2007 is better than nothing:
Create your PT in the normal way (Country for Row Labels, Year for Column Labels, Sum of Invoiced for Σ Values).
If present, remove the Grand Totals for rows (Select the PT, Pivot Table Options…, Totals & Filters, uncheck Show grand totals for rows). The Grand Totals for columns may be kept, but the value there in a column to be added would not be meaningful.
Select a column header (say 2013) and in Options > Tools – Formulas select Calculated Item…
In Name: select something suitable (perhaps ΔYonY) and for Formula: enter =('2013' -'2012' )/'2012'.
Set font colour of bottom right-hand cell to match fill.

pnuts' answer is accurate.
If you are looking for a way to have this calculated automatically in the PivotTable, you can use calculated fields.
In order for this option to work, you will likely have to change the way your data is structured.
I'm assuming right now you have a data column with Sales Date. You will need to add one column per year, and assign a value to it in your data. You can then get rid of your invoice column.
Click anywhere inside your pivot table, in the ribbon go to Fields Items & Sets, Calculated field.
In the formula, type in what you need (you can use the fields list to add them in). I did =('2013'-'2012')/'2012'
You can then of course change the formatting to be in %
See screenshot for old vs proposed.

Related

Create a calculated pivot table column in excel based off other columns in the pivot table?

So I have a bunch of rows in a query table that shows orders from a certain timeframe and whether that order had a "defect" or not. I have started a pivot table on that table to summarize the # of orders and # of those orders that were defective by day (trying to start a p-chart).
Is there any way to create a 4th column in the pivot table that calculates the percent defective (Orders with Defects/Count of Orders) from the two existing columns?
Sure,
Based on this site, these are the steps:
To start, select any cell in the pivot table
Next, on the Excel Ribbon, go to the PivotTable Analyze tab
In the Calculations group, click Fields, Items, & Sets
Then, in the drop-down menu, click the Calculated Field command
Once there give a name to your Calculated Field and set your formula to Orders with defect / orders (tip: select the fields from the list to make sure you get the names right).
One last note: I believe calculated fields perform additions by default.. I noticed your 2nd column is a "count", I believe the calculated field will sum that column (before dividing) instead of counting it.

How to find % change between values in 2 columns in a Pivot table?

I have created a Pivot table on a dataset in Excel. I have 2 columns for yearly values and want to insert a new column in the pivot table for % change between them.
I've tried using the "Field Settings" to find percent difference, but it doesn't give the desired result.
This assumes you don't have gaps between years.
Add the amount field to the values section of the pivot table, so that it is there twice.
Right-Click one of the values in the newly added
Choose Show Values As -> % Of ... ->
Base Field should be: Year and Base Item should be: (previous)
Rename column to % Difference
It will show for every year, so hide the column for years that you don't want it
Not too hard, when you have your pivot table:
Select any cell
Go to Excel Ribbon > PivotTable Analyse > Fields, Items & Sets > Calculated Field
Give a title, e.g.: % Difference and add a formula:
= ('2018-19'-'2017-18' )/'2017-18'
Confirm and once confirmed, change the datatype of this field to percentage
Note, things might be named a little different in your Excel since I'm using a Dutch Excel 2019 version.

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.

Summarise data based on date

I have a set of data in excel that looks like this:
Project Name alpha date alpha price beta date beta price final date final price
Project a 1/01/2013 $123.00 2/02/2013 $324.00 5/02/2013 $222.00
Project b 2/01/2013 $432.00 9/03/2013 $111.00 30/03/2013 $321.00
project c 2/02/2013 $4,431.00 8/03/2013 $231.00 7/04/2013 $343.00
project d 3/04/2013 $1,232.00 30/01/1906 $3,122.00 6/07/2013 $666.00
I need to generate a sum for each month/year across all projects and phases of the project. IE:
Jan 2013 $555
Feb 2013 $4,977
What's the best way of going about this?
This is a good use case for pivot tables.
Highlight the date columns, right click, Format Cells.. menu item. Then use a Custom Data format of MM/YY to get everything in month and year format.
Once all the dates are converted, highlight the entire table then make a Pivot Table of the data (use Create Menu). Place pivot table on new sheet.
Use the pivot table to group and sum data as needed. You can drag the various projects into pivot table rows, and then combine cost columns using the sum() function. Add filters or project groups where needed.
If you've never used pivot tables, I highly recommend taking 30 minutes to learn. They are very intuitive and powerful.
Good luck!
A suggestion is to ‘reverse pivot’ (eg as described An excel formula to find a row/column index in array) and double click on the intersect of the Grand Totals. Insert a column with:
=MONTH(Table1[[#This Row],[Value]])&" | "&YEAR(Table1[[#This Row],[Value]])
and a column with, in the first row below the headers (assumed to be Row1): =C3 where C is assumed to be the Value column.
Copy the Table and Paste Special Values.
Filter the Column column and delete all rows containing price.
Sort the month/year column and Subtotal, for each change in that column, the other added column.

Excel pivot table exclude some column totals

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.

Resources