I need to calculate the average of the values in the right column, this is a pivot table (IMG1). I can't find a way to do this, also using "Totals and aggregation", and COUNT (DISTINCT ) function to count how many different values are there in the row on the left (as the Pivot Table does) and then divide that number for the sum of the values in the right column is not feasible, because the (DISTINCT) part of the function behaves in a strange way: when I verify it it says "valid function"(IMG2), but then when I load the data page, i get the message "Error in formula" instead of the datas