The formula for calculating the mean (long method) from classified data is given by \( M = \frac{\sum fix}{N} \),
where
\( f \) represents the frequency of the class,
\( x \) represents the mid-value of the class, and
\( N \) is the total number of observations.
Thus, the correct answer is (D).