The benchmark S&P 500 has climbed more than 17% so far this year, galloping higher despite concerns over a surge in inflation and a projected fall-off in economic growth.

At the same time, however, stock valuations have edged lower since the start of the year. The S&P 500's price-to-earnings (P/E) ratio, a commonly used measure of the market's valuation, stands at 21.4 times earnings estimates for the next 12 months, according to Refinitiv Datastream. That is still well above its 15.4 historical average, but below the 22.7 level from January.

Meanwhile, a rally in Treasury markets that has seen the yield on the 10-year Treasury note fall 50 basis points since late March as bond prices shot higher has also helped raise the allure of stocks as an investment.

"I think the stock market is still the place to be," said Peter Tuz, president of Chase Investment Counsel in Charlottesville, Virginia. "Even though valuations are lofty, the fundamentals are good, most companies are having excellent quarters and the outlook is pretty good."

The focus on valuations comes as investors assess various cross-currents that can sway markets over the next few months, including an expected slowdown in growth, a resurgence of U.S. COVID-19 cases and the Federal Reserve's plans for unwinding the easy money policies that have helped support asset prices since the pandemic-fueled sell-off in March 2020.

Investors will get a fresh snapshot of the economy next week with the monthly U.S. jobs report and another batch of earnings reports from companies such as Eli Lilly, CVS Health and General Motors.

Expectations of strong future earnings have been the key driver of the S&P 500's gains this year, according to a Credit Suisse analysis of the index's year-to-date performance that compared change in stock valuations with changes in expected earnings.

Continued better-than-expected earnings are poised to keep valuations in check. Earnings are now expected to have climbed 87.2% in the second quarter versus forecasts of 65.4% at the start of July, according to Refinitiv IBES.

"If you have an environment like the one we are in where the companies are beating expectations by 18-20%, that means that the P/E is lower than the official number," said Jonathan Golub, chief U.S. equity strategist at Credit Suisse. Credit Suisse projects the S&P 500 will end the year at 4,600, about 4% above Thursday's close of 4,419.15.

Google-parent Alphabet and Boeing have been among the season's big earnings beats. Investors were less happy with Thursday's report from e-commerce giant Amazon, whose shares took a hit after it said sales growth would slow in the next few quarters.

The fall in bond yields, with the 10-year yield dropping recently to about 1.25%, has also boosted the relative attractiveness of stocks.

The equity risk premium - a comparison of the earnings yield on stocks to the interest rate on bonds - currently is at a level that has historically corresponded to an average 12-month gain for the S&P 500 of 15.2%, according to the Wells Fargo Investment Institute.

Goldman Sachs said in a recent note that its S&P 500 year-end target of 4,300 is predicated on a 10-year yield at 1.9%. A yield of 1.6%, still more than 30 basis points above where yields stand currently, would lift Goldman's fair value estimate for the S&P to 4,700 by year end, keeping the modeled growth and other factors constant, the bank said.

Still, some investors have grown nervous over stock valuations, which are elevated by many historical measures despite recent earnings blowouts.

One valuation metric flashing warning signs is the cyclically adjusted price earnings ratio, or CAPE ratio, which takes a longer-term view to adjust for gyrations in business cycles. It has climbed to its highest level in more than 20 years.

The rise in the CAPE ratio was one factor that Cresset Capital Management considered before modestly scaling back its overall equity exposure earlier this year for its portfolios that have at least a 7-year investment horizon, said Cresset chief investment officer Jack Ablin.

"Stock valuations are expensive, extremely expensive," he said. "From that lens, the market does not have a very compelling long-term future."

(Reporting by Lewis Krauskopf; Editing by Ira Iosebashvili and Dan Grebler)

By Lewis Krauskopf