Shares of CarMax (NYSE:KMX) were trading nearly 6% lower in early-morning trading after the company reported its second-quarter earnings. The move seems a bit harsh to me, considering the company beat bottom-line expectations and only slightly missed top-line revenue estimates. Despite Wall Street not being happy with CarMax's second-quarter results, there was plenty to be optimistic about. Let's dig in.

By the numbers
Consensus estimates from Thomson Reuters called for earnings per share to check in at $0.76 on revenue of $3.96 billion. CarMax delivered on the bottom line, beating expectations with earnings per share of $0.82, but missed on top-line revenue expectations slightly, with revenue checking in at $3.88 billion.

Despite the top-line miss, CarMax's second-quarter sales figures looked solid. Total used-vehicle unit sales grew 9.2% compared to last year, and comparable-store used unit sales were up 4.6%. The latter's improvement was driven by improved conversion and better execution by individual store teams. The only "problem" is that CarMax's comparable-store sales increase of 4.6% was less than previous years that have posted higher single-digit increases. Essentially, the increase was good, but just not good enough for Wall Street.

Looking at average selling prices of used vehicles, CarMax averaged $19,983 during the second quarter, which was a 1.1% decline compared to last year. However, as management noted on the conference call, the best way to judge average pricing is sequentially, and by that measure $19,983 was an improvement over the first quarter's $19,851 average used-car selling price. Furthermore, for additional context, CarMax's second-quarter used-car average selling price is still extremely strong when looking at historical figures.

Kmx
Chart by author. Data source: CarMax's annual reports and Q2 FY 2016 press release. 

Beyond CarMax's strong used-vehicle selling prices, the company's gross profit per used unit remained consistent at $2,166 with margins at 10.8% -- the latter figure is only slightly below historical norms of between 11% and 11.5%. Ultimately, when adding gross profit for all of CarMax's used-vehicle sales, new-vehicle sales, wholesale, and other gross profit, CarMax's total gross profit rose 12.5% to $521.4 million in the second quarter, compared to last year.

CarMax also continued returning value to shareholders during the second quarter by spending nearly $250 million to repurchase 3.9 million shares under its repurchase program. Also during the second quarter, CarMax opened four stores: one in Providence, Rhode Island; two in Denver; and another in Tallahassee, Florida. Already in the third quarter, CarMax has opened its sixth store in Houston and a second store in Minneapolis, with even more scheduled in the coming quarters.

Kmx

Table source: CarMax's Q2 FY 2016 earnings release. 

Despite shares of CarMax trading down today, the company continues to post increasing comparable-store sales as well as total used units sold. Margins and gross profit per used vehicle remain consistent and near historic highs, and the company continues to return value to shareholders by repurchasing more shares when its stock price trends lower. In my humble opinion, it seems like the second quarter was much better than the sell-off suggests, and long-term shareholders should remain optimistic that the company is still performing very well.

Daniel Miller has no position in any stocks mentioned. The Motley Fool owns and recommends CarMax. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.