Billionaire investor Warren Buffett once summarized the secret to his success in a single sentence: "All there is to investing is picking good stocks at good times, and staying with them as long as they remain good companies."

That advice is somewhat subjective, but I believe Paycom Software (PAYC -3.67%) and MercadoLibre (MELI -2.80%) meet those criteria. Both companies have reported strong financial results like clockwork in recent years, and both stocks currently trade at a discount to their historical valuations.

Here's what investors should know.

1. Paycom Software

Paycom specializes in human capital management (HCM) software. Its core product is payroll software, but its portfolio also includes applications for recruiting, scheduling, training, and other human resources tasks like benefits administration. In short, Paycom allows businesses to manage the full employee lifecycle from a single platform. That makes its software a compelling option, because most organizations currently rely on multiple vendors to meet their HCM needs.

HCM software may not be cutting-edge technology, but Paycom has still differentiated itself through product innovation. The company launched the industry's first self-service payroll software in 2021. The product, nicknamed Beti (Better Employee Transaction Interface), automates payroll by requiring employees to review and approve their pay prior to processing. That ultimately improves operational efficiency by reducing the amount of time administrators spend correcting payroll errors. For context, payroll errors cost about $250,000 per 1,000 employees, according to research from Ernst & Young.

Paycom delivered stellar financial results in the first quarter. Revenue jumped 28% to $452 million, and GAAP net income rose 30% to $2.06 per diluted share. Of course, Buffett would probably say one good quarter hardly qualifies Paycom as a good company. But Paycom has consistently delivered solid financial results. Revenue has increased at 26% annually over the last five years, and investors have good reason to believe that momentum will continue.

Paycom has captured just 5% of its total addressable market (TAM) in the U.S., per CEO Chad Richison. But it recently expanded beyond the domestic market, meaning its TAM just got a lot bigger. In April, Paycom announced Global HCM, a product that brings its HCM applications to international businesses. That means clients that operate in multiple global geographies can standardize on a single HCM platform.

As a caveat, Paycom would almost certainly struggle during a recession. Its revenue depends on how many employees use its software, so rising unemployment brought on by a recession would be a problem for Paycom. That said, the problem would be temporary, and the stock is still worth buying today. Shares currently trade at 10.7 times sales, the cheapest valuation at any point in the last five years, and a reasonable price to pay given the company's solid execution and growing market opportunity.

2. MercadoLibre

MercadoLibre runs the largest online commerce and payments ecosystem in Latin America. Its e-commerce marketplace receives about four times more visitors each month than the next closest online shopping destination, and the company accounted for nearly 21% of retail e-commerce sales in the region last year. That success stems in part from brand authority. MercadoLibre helped popularize e-commerce in Latin America, and its first-mover status has given the company plenty of time to build trust with merchants and consumers.

MercadoLibre has further cemented its leadership in e-commerce by building a number of adjacent businesses. Its subsidiaries provide merchant solutions for fulfillment, financing, advertising, and payment processing, all of which make its marketplace more compelling. MercadoLibre also provides financial services to consumers. Its subsidiary Mercado Pago is the third most popular digital wallet in Latin America.

MercadoLibre reported solid financial results in the first quarter. Revenue increased 35% to $3 billion, and GAAP net income soared 205% to $3.97 per diluted share. More importantly, the company has consistently delivered solid financial results over the long term. Its revenue has increased at 54% annually over the past five years, and investors have good reason to believe MercadoLibre can re-accelerate growth in a more favorable economic environment.

Specifically, MercadoLibre has several tailwinds at its back. Latin America has one of the fastest-growing internet penetration rates in the world, and that is paving the way for explosive growth in the digital economy. According to Statista, e-commerce sales and digital payments volume will grow at 14% and 15% per year, respectively, through 2027. Latin America is also the fastest-growing digital ad market in the world at the present time.

Shares currently trade at 5.8 times sales, an absolute bargain compared to the five-year average of 12.4 times sales. That's why this growth stock is worth buying.