Offer your insights or judgment on the input financial query or topic using your financial expertise. Reply as normal question answering

How to calculate P/E ratio for S&P500 sectors
To calculate a sector (or index) P/E ratio you need to sum the market caps of the constituent stocks and divide it by the sum of the total earnings of the constituent stocks (including stocks that have negative earnings).  There are no "per share" figures used in the calculation. Beware when you include an individual stock that there may be multiple issues associated with the company that are not in the index.... eg. Berkshire Hathaway BRK.B is in the S&P 500 but BRK.A is not.  In contrast, Google has both GOOGL and GOOG included in the S&P 500 index but not its unlisted Class B shares.  All such shares need to be included in the market cap and figuring out the different share class ratios can be tricky.