I'm trying to organize to perform some calculations in a Pivot Table, but not all of them are working the way I intended. The table is based on an array of cells in Excel.

Here is an example of what I mean:

In the main spreadsheet there is a big list of the price per pound for different fruits and nuts at different locations.

oranges 1.50
apples 0.99
almonds 1.34
oranges 2.01
peanuts 0.75
peanuts 1.99
apples 1.11
...

What I want from the Pivot table is this:

Average price per pound for each type of fruit and nut as well as the average price per pound for all fruits as a group and all nuts. I've already grouped the fruits and nuts together and I actually already have the average price per pound for the groups and each specific type.

But what I can't do is make some other calculations. I need the MEDIAN price per pound for each type and the groups. I entered my formula according to the help directions for custom calculations, but instead of giving me the median price per pound, I end up with the "Sum of Median." For example, if I have 100 different prices for oranges, which I know have a median price of 1$, the Pivot Table returns a value of 100 x 1$ = $100. The same occurs for each group and for each specific type.

I want to perform other calculations in the Pivot Table, but each time the answer I'm looking for is "summed." The help file notes that this is the default setting for numerical values (or something like that), and I can't remove the sum setting because it is greyed out.

Does anyone know how to get the median (or any other function or formula) from the Pivot Table without it being summed? Any help would be appreciated.