Hi susanto3311! Welcome to MHB! :)
The formula for your mean is:
$$Mean = \frac{
\overbrace{35+35+...+35}^{6}
+ \overbrace{40+40+...+40}^{8}
+ \overbrace{25+25+...+25}^{12}
+ \overbrace{20+20+...+20}^{24}
}{6+8+12+24}$$
In your picture each of the sums under an overbrace has been put in a separate cell. The result is calculated afterwards.
In Excel, you can do it in one formula: [m]=SUMPRODUCT(A2:A5, B2:B5) / SUM(B2:B5))[/m].
This is the same formula as the one that Mark gave, just in Excel style. (Wasntme)