anantathaker
Board Regular
- Joined
- Jan 7, 2005
- Messages
- 71
Hi guys,
So I have a dataset with columns structured like this:
Category Subcategory # of entries avg. price
Basically, within each category there are 5 or so subcategories. And for each subcategory, I have the number of entries and the average price.
I want to calculate the weighted avg price for a category, so the way I am doing that right now is by doing a weighted avg. Basically, I take each subcategory avg price and multiply by (subcategory # of entries / category # of entries). I then sum up these weighted subcategory avg prices to get a category avg price.
But there are lots of categories, and each has a different number of subcategories. So doing the manually takes a long time, in that I have to continually change ranges, etc. Is there a way to have a more automated formula? Can I use IF statements somehow? Anything would be helpful
So I have a dataset with columns structured like this:
Category Subcategory # of entries avg. price
Basically, within each category there are 5 or so subcategories. And for each subcategory, I have the number of entries and the average price.
I want to calculate the weighted avg price for a category, so the way I am doing that right now is by doing a weighted avg. Basically, I take each subcategory avg price and multiply by (subcategory # of entries / category # of entries). I then sum up these weighted subcategory avg prices to get a category avg price.
But there are lots of categories, and each has a different number of subcategories. So doing the manually takes a long time, in that I have to continually change ranges, etc. Is there a way to have a more automated formula? Can I use IF statements somehow? Anything would be helpful