Pivot Tables - Comparing Grand Totals to each other

arveearv

New Member
Joined
Apr 29, 2013
Messages
12
Office Version
  1. 2016
Platform
  1. Windows
  2. MacOS
Hi:

Imagine a medical clinic where there are, say, 5 doctors who each have their own list of patients. Every once in a while, though, one doctor will pitch in and see the patient of a colleague.

Here is a sample set of data:

FHO_SampleImage_Data.JPG


Here's a pivot table that summarizes the data:
FHO_SampleImage_pivot.JPG

So far, so good. But now I want to know, for each doctor, how much more (or less) they are contributing than receiving. Doctor2, for instance, has provided a Grand Total of 2 care units to patients that belong to someone else, but Doctor2's patients received 3 units of care from other doctors. So Doctor1's "Grand Total Difference" should be +1.

How can I calculate this, given that the Grand Totals columns will always be in different places, depending on how many doctors are providing care in a clinic?

Thanks!
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hi:

I think I may have answered my own question. See if this makes sense. Alas, this is a time when the "Sumif" function trumps the Pivot Table!

Instead of using the Pivot Table data, I used the raw data (shown in the Top graphic, above). For each doctor, I created a new cell called "Balance". Here's the formula for "Doctor3":
=SUMIF(B:B,"Doctor3",D:D)-SUMIF(C:C,"Doctor3",D:D)

It works, but I think the Pivot Table met its match with this one.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,030
Messages
6,122,762
Members
449,095
Latest member
m_smith_solihull

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