简体   繁体   中英

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

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:

  1. Create your PT in the normal way ( Country for Row Labels, Year for Column Labels, Sum of Invoiced for Σ Values).
  2. 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.
  3. Select a column header (say 2013) and in Options > Tools – Formulas select Calculated Item…
  4. In Name: select something suitable (perhaps ΔYonY ) and for Formula: enter =('2013' -'2012' )/'2012' .
  5. Set font colour of bottom right-hand cell to match fill.

SO19491492示例

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.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM