Consider the following data points: $1, 1, 2, 3, 4$
I understand that... the average is the total of the numbers divided by the count of numbers in the set, the median is the central value based on location in the set, the mode is the value occurring most often in the set, and the midrange is highest and lowest values divided by $2$.
Is there a name for the calculation of the average based on the unique values found in the set? So... $\frac{1 + 2 + 3 + 4}{4} = 2.5$? And is there a use for it?
Pardon a possibly elementary question, I'm a programmer but I'm not exactly a math-oriented person, and this has been bugging me recently.
From a practical viewpoint, I wouldn't think so. For that example $ (1, 1, 2, 3, 4) $ your procedure gives $ 2.5 $. If the data points had instead been $ (1, 1.01, 2, 3, 4) $, however, the result would jump to about $ 2.2 $. The most common useful properties would seem to depend continuously upon the data, however.
Since I don't know the application for which you're using that kind of average, though, it may well turn out to be helpful. In this case, I'd recommend simply spelling it out as you did here.