Solved

How to calculate Difference for two year in a Pivot Table using a Forumlas

Posted on 2013-05-23
11
319 Views
Last Modified: 2013-05-24
I have a Pivot table that has the rows as users Columns label is Date (Year) and Sum of Values,
Values are sum per user for Bills and Sum per user Paid.


Pivot Img
I need to calculate the difference between 2012 - 2013 paid as well as 2012 - 2013 Billed.

I see there is a Difference From option as well as using formulas.

Should I just do the calculation outside the PivotTable?
0
Comment
Question by:yo_bee
  • 6
  • 4
11 Comments
 
LVL 19

Expert Comment

by:helpfinder
ID: 39192152
if you use some column outside of the pivot with formulas and references to the Pivot table cells in these formulas then you should calculate it without any problem
0
 
LVL 22

Author Comment

by:yo_bee
ID: 39192161
All columns being references are within the PivotTable.
0
 
LVL 19

Expert Comment

by:helpfinder
ID: 39192197
do you mean like this? (attached sample)
Book1.xlsx
0
 
LVL 22

Author Comment

by:yo_bee
ID: 39192503
Yes
0
 
LVL 22

Author Comment

by:yo_bee
ID: 39192530
Note: My dates are Grouped by Year, Month
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 19

Expert Comment

by:helpfinder
ID: 39192783
OK, but in your screen I see only years - if you need to apply specificely to you your case, please attach your data (or sample) to check
0
 
LVL 22

Author Comment

by:yo_bee
ID: 39192937
attached is the file
Book1.xlsx
0
 
LVL 1

Accepted Solution

by:
cybermanoj4u earned 500 total points
ID: 39193570
While pivot tables are very useful features for analyzing and explaining data in Excel, they can also be confusing to work with. Some functions, such as calculating differences, must be accomplished in a certain way if they are to work correctly. The process is not well explained within Excel's help feature, so here's how to calculate difference in pivot tables without using extraneous formulas. Below are the steps.

Steps

> Launch Microsoft Excel.
> Open the spreadsheet containing the pivot table and source data you are working with.
> Select the worksheet tab containing the source data.
> Determine the calculation you would like to add.
> Insert a column for the calculated difference amounts.
> For instance, assume you want your pivot table to include a field showing the difference between column G and column H and both columns contain numerical fields.
> Right-click on column I and choose "Insert Column" from the pop-up menu. A column will be inserted to the right of column H and all columns of data beyond that column will be shifted one place to the right.
> Enter a name for the column such as "Difference."
> Create a formula in the first cell of your new column to calculate your differences.
> Make sure you choose the correct syntax for your formula to return a positive or negative number as desired.
> Copy and paste the formula through the rest of the new column.
> Click on the ¿worksheet tab containing your pivot table, if it is different from the location of your source data.
> Alter the source data for your pivot table
> In Excel 2003, relaunch the pivot table wizard utility by clicking inside the pivot table and choosing "Wizard" from the pop-up menu.
> In Excel 2007 or 2010, click the "Change Source Data" button on the Pivot Tools Options tab.
> Either click and drag to highlight a new range or simply edit the range formula already in the "Range" field to include the following column.
> Refresh your pivot table by clicking the "Refresh" button.
> Add the difference column to your pivot table by clicking the column name, dragging it and dropping it into the "Values" field of the pivot table wizard.
> You may need to reorder the column names in the "Values" section to make the columns appear in your pivot table in the correct order. You can click and drag from the "Values" section or directly within the pivot table to rearrange the order of your columns


Source for More Information

http://office.microsoft.com/en-us/excel-help/pivottable-reports-101-HA001034632.aspx
0
 
LVL 19

Expert Comment

by:helpfinder
ID: 39193573
Hi, so now I extracted year from your dates and created pivot based on year
Check attachments. (2 versions attached)
Copy-of-Book1.xlsx
Copy-of-Book2.xlsx
0
 
LVL 22

Author Comment

by:yo_bee
ID: 39194763
@HelpFinder:

That is what I was hoping to avoid. I want to use the Formula tool to create a field within the pivot table.
0
 
LVL 22

Author Closing Comment

by:yo_bee
ID: 39195550
I was not able to get to the final result from your solution, but it pointed me in the right direction.

Found what I was looking for.


I needed to Drag the Fees Bill Field and change it from sum to show value as, Selected the option Difference From and where I was going wrong before was choosing my base field

I just need to select Years (from the grouping) then Previous and it worked.

Thanks for the effort guys, but
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now