Walmart was the lead buyer for months in talks to buy online pharmacy start-up PillPack. But Amazon swooped in, ultimately making a higher offer of around $1 billion. Losing that deal ended up costing Walmart about $2.3 billion, at least in terms of market value. Here's how.

According to a person familiar with the discussions, Walmart's original offer was just over $700 million, but Walmart dallied in closing the deal because of regulatory concerns. Meanwhile, Amazon had already been interested, then ramped up talks after CNBC's April report that PillPack was in acquisition talks.

After the news was announced on Thursday by the two companies, Walmart's stock took a tumble, along with the largest drug supply chains. The company lost $1.03 between Wednesday's close and Thursday's close, falling from $86.89 to $85.86. That loss, multiplied by 2,950,844,393 shares outstanding based on their 10-Q from earlier this month, yields a loss in market value of $3.04 billion.

So buying PillPack would have cost $700 million. Not buying it? $3 billion.

Walmart declined to comment.

-- Additional reporting by Lauren Hirsch













