Morningstar writes that "The (P/E) ratio of a fund is the weighted average of the price/earnings ratios of the stocks in a fund's portfolio."https://www.morningstar.com/invglossary/price_earnings_ratio.aspx
Well, not exactly. Or at least I hope not. According to its 2005 methodology paper, "Morningstar now exclusively uses a harmonic weighted average method for calculating the average price ratio for an investment portfolio." https://studylib.net/doc/7944379/average-price-ratios
That's just a fancy way of saying that it takes the weighted average of E/P ratios and then inverts the average E/P to get the P/E for a fund. Which is really what one wants if one thinks about what P/E (or E/P) represents.
A P/E ratio tells you how many dollars you have to pay for one dollar of annual earnings. Suppose you have invested $2, half in a stock earning 10¢ per dollar invested (P/E of 10), and half in a stock earning 2¢ per dollar invested (P/E of 50). Then for your $2, you're getting 12¢ of earnings, for a P/E ratio of $2/$0.12 = 16⅔. Not 30 (the average of 10 and 50).
Of course there are still all sorts of variants: current P/Es, projected P/Es, excluding negative earnings, etc. This is just looking at the formula for fund average P/E, not what P/E values you plug into that formula.
Some pages explaining this::Mean well - Why the average of 10 and 50 is not necessarily 30
- where it writes 162/3x it means 16⅔xP/E for a fund or an index
- the index calculation it gives is equivalent to the fund calculation (left as an exercise for the reader)Your Mutual Fund's P/E is Likely Very Wrong
- focuses more on the variants (whether negative earnings should be excluded) than the basic calculation