Pivot Tables - Comparing Grand Totals to each other

arveearv

New Member
Joined
Apr 29, 2013
Messages
5
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!
 

Some videos you may like

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

arveearv

New Member
Joined
Apr 29, 2013
Messages
5
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:

Watch MrExcel Video

Forum statistics

Threads
1,122,327
Messages
5,595,526
Members
413,996
Latest member
mabelO

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
Top