I'm sure the math can be done if I can understand what you're looking for. So Joe sells a number of items at a variety of prices, whatever the market will bear each day. In the grid you want to see:
Code:
Item Qty Avg Price
------------------------------------------
Moonstone 75 350p
Sunstone 65 135p
Arrows 5200 75s
Spell Scroll 1 14500p
Apple Pie 10 50g
Fireplace 3 9999p
------------------------------------------
You want to sort by average price paid to see which item, on average, generated the most (or least) income per each. In Joe's case the spell scroll averages the most, and arrows average the least. Is that about right?
.