Why do companies use weighted average count as opposed to the ending diluted share count?
Remember that the income statement reflects a period of time. Over the period of time the number of shares outstanding can fluctuate for a variety of reasons related to share buybacks, share issuances, and dilution.
In these cases, simply using the diluted share count at the end of the period would result in a compressed earnings per share value if shares outstanding increased over the period. To illustrate this idea further, imagine a company has 100 shares outstanding, then at the end of the year doubles its share count to 200. If the company had $100 in net income, dividing net income by diluted shares outstanding would yield $0.50 EPS ($100/200 shares). Yet, this number is actually supposed to be a lot closer to $1.00 EPS because for most of the year, the company only had 100 shares outstanding.
Hence, it would be more accurate to take a weighted average of the share count to get 100.27 shares [(364/365 x 100) + (1/365 x 200)], which yields $0.99 EPS.