Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Pivot Table Question 1

Status
Not open for further replies.

dianemarie

Instructor
Jul 11, 2001
583
US
I have a fairly simple pivot table that compares quantities from two different sources to see if there is any discrepancies between the two databases. So the completed pivot table looks like this:

Database A Database B Total
Order A $1000 $1000 $2000
Order B $500 $500 $1000
Order C $450 $432 $882

But I would like to see the Total column, which the pivot table generated, calculated as a difference instead of a total (Database A - Database B instead of Database A + Database B). Right now I'm copying and pasting values and then inserting my own formula to check for any difference not equal to 0 (thereby pointing me to the orders where there is a discrepancy between the two databases). Is this possible using the pivot table wizard? Thank you.
 
This is known as a calculated item in the pivot table. The first step is to ungroup your Database column. Click on the heading "Database B", click the right mouse button over your pivot table and select Group and Outline, Ungroup.

Leaving "Database B" selected, click the right mouse button again and select Formulas, Calculated Item. Type a name for your item (eg "Difference"). Under Fields, select "Database A" then Insert Item. Type the minus sign, then under Fields select "Database B", Insert Item, OK.

If you also want to remove the Grand Total column, click the right mouse button over your pivot table and select Options, then remove Grand total for rows.

Good question - I hadn't tried this one before, so I've learnt at least one new thing today! :->
 
Wow!! I love it! Thank you GeekGirl (you are totally NOT a geek!). This site rocks. (I hang out with my 11 year old son way too much.)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top