I am keeping track of my (stock) portfolio in Google Sheets, as follows:
category subcategory company amount
-------------------------------------------
health care diagnostics AA 100
health care diagnostics AB 50
materials mining BA 75
financials banks CA 30
financials insurers CB 35
financials banks CC 10
financials banks CD 40
financials hedge fund CE 5
health care equipment DA 50
But now I want to extract some statistics from this, and I'm using a Pivot. Specifically, I want to see:
- the relative size of each
categoryin the portfolio - the relative size of each
subcategoryin the portfolio - the relative size of each
companyin theirsubcategory
The first two I get done:
For instance, I can see that:
- category
financialshas a relative size of30%in the portfolio - subcategory
diagnosticshas a relative size of37.97%in the portfolio
What is missing however, is the third column, see mockup below:
I can now see in the last column what the relative size of each company is in its subcategory:
- Company
CDis50%of the subcategorybanks - Company
ABis300.33%of the subcategorydiagnostics
That last column however, is not calculated but added manually to show what output I am trying to get but am unable to.
Does anyone know how to have this last column as part of the Pivot?
Here is a link to the Google Sheet used: Pivot






