Calculate Pivot Table Variance

Ren123

New Member
Joined
Aug 30, 2016
Messages
3
Does anyone know how I can calculate a variance when my raw data looks like this and my pivot table is structured like that? Based on what I've read, my 'years' have to be in columns. The file I am working with is combining two periods with the year embedded in the line item detail and the file is huge, so that is not realistic to break years into columns. I also tried to calculate outside of the PT.

Raw Data
loc 1 175 2016
loc 2 167 2016
loc 3 528 2016
loc 4 654 2016
loc 1 214 2015
loc 2 425 2015
loc 3 136 2015
loc 4 569 2015

Pivot Table
2015 2016
Loc 1 214 175
Loc 2 425 167
Loc 3 136 528
Loc 4 569 654

Thanks!
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Drag year then loc into rows, number into values:


Excel 2010
ABCDEFGH
1placenumberyear
2loc 11752016
3loc 21672016
4loc 35282016
5loc 46542016Row LabelsVar of number
6loc 121420152015
7loc 24252015loc 1480.5
8loc 31362015loc 238642
9loc 45692015loc 33362
10loc 17922016loc 451520.5
11loc 276020162016
12loc 37582016loc 1190344.5
13loc 46662016loc 2175824.5
14loc 12452015loc 326450
15loc 21472015loc 472
16loc 3542015
17loc 48902015
Sheet37
 
Upvote 0
So the quick and dirty way:

PivotFields:
Columns: Year
Rows: Raw
Values: Data

Then on the side, =B3-C3 (in cell D3) and drag down. A3 = LOC 1, B3 = 214, C3 = 175.

You can also use a calculated field in the Pivot Table, but I would need to test before I would be comfortable posting.

Cheers.
 
Upvote 0
So the quick and dirty way:

PivotFields:
Columns: Year
Rows: Raw
Values: Data

Then on the side, =B3-C3 (in cell D3) and drag down. A3 = LOC 1, B3 = 214, C3 = 175.

You can also use a calculated field in the Pivot Table, but I would need to test before I would be comfortable posting.

Cheers.

Thank you! That did it! Appreciate the help!
 
Upvote 0
Is this what you wanted?

kT9P1oS.png



(I thought you meant variance as the sum of squared differences from the mean divided by n-1 rather than merely the year over year difference, and that the years should NOT be in columns)
 
Upvote 0

Forum statistics

Threads
1,216,031
Messages
6,128,424
Members
449,450
Latest member
gunars

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top