Unless you've been living under a rock, you've already heard that, per the latest economic data hot off the presses, U.S. inflation rose by 7.5% in the past year. As intimidating as that figure may be, I have some good news for you. It just might be possible to protect your hard-earned cash from the detrimental impact of inflation by parking it in the right pharmaceutical stock.

Of course, many other types of stocks could also be a better move than holding your wealth in cash. But I'm of the opinion that pharmas have at least one edge against inflation that makes them a decent choice, at least in some cases. Let's investigate why inflation isn't likely to cause too much damage to the companies responsible for developing and commercializing new medicines. 

A shopper ponders bottles of medicine while standing in a pharmacy aisle.

Image source: Getty Images.

Input costs aren't exactly a problem

The biggest thing to realize about pharma stocks is that the prices of the materials they need to manufacture and sell drugs aren't necessarily tightly linked to inflation. Consider the two pharma giants, Eli Lilly (LLY -2.63%) and Merck (MRK 0.44%). Flying in the face of inflationary pressure, the quarterly cost of goods sold (COGS) as a percentage of revenue actually dropped for both companies over the past year.

LLY Cost of Goods Sold (% of Quarterly Revenues) Chart

LLY Cost of Goods Sold (% of Quarterly Revenues) data by YCharts

As a result, their profit margins and net income actually both increased by a bit in the same period. If inflation were a serious threat to their bottom line, the costs of their inputs would have risen and forced their margin down accordingly. There's no guarantee that further increases in the pace of inflation won't start to make life more difficult for these companies, but they also have a powerful trick up their sleeve: pricing. 

If you're skeptical that pricing is the ultimate solution to inflationary cost increases in pharma, consider the following: 

Eli Lilly makes an insulin analog called Humalog, which helps patients to control diabetes. Most people who need the drug require consistent infusions of it, and they can't go without it, as doing so is a risk to their health. Furthermore, most patients are somewhat insulated from the cost of their prescriptions for the medicine via their insurance or public healthcare scheme. 

Thus, if inflation causes Eli Lilly's costs to produce Humalog to increase, it can count on being able to hike the price per dose without losing many customers. And that's one more reason why inflation is unlikely to cause much of a dent in its profits. 

Keep an eye on the total return

The other issue with inflation is that it can erode the effective return that investors get from their holdings -- unless the value of your shares can grow by as much as inflation. Take Eli Lilly, for example. Over the past year, it had a total return of 18.4%, which is derived from its share price appreciation and dividend yield of around 1.4%. Happily, the stock appreciated in value more than the inflation rate, which is a good sign. But that's not the whole story.

Assuming inflation remains at 7.5% year over year, Eli Lilly's dividend payment needs to increase by at least the same rate in order for its contribution to the total return to remain constant in terms of its real value. Luckily, the company's dividend grew by 15.3% in the past 12 months. So it rose by significantly more than the rate of inflation, meaning that investors did actually get a positive return from holding their shares on the basis of the dividend as well as the total return. 

The same set of facts won't necessarily be true for every pharma stock. Over the past year, the total return of Merck's shares was roughly 7.5%, and its dividend increased by only 6.2%. That means the payout lost ground against inflation, and the total return barely broke even. In other words, inflation was indeed a threat to the value of investors' shares of Merck because it killed their real returns. 

In short, inflation may not be a threat to the actual operations of pharmaceutical companies, but it can be a significant concern for investors because the returns of slower-growing pharmas might not keep pace. So it may be wise to invest at least a portion of your investment portfolio in smaller and faster-growing companies, which are more likely to be able to outgrow inflation's detrimental impact on returns.