The shares of Procter & Gamble were up 2% in premarket trade on Wednesday, following price hikes and strong consumer demand for its healthcare and homecare products drove revenue over expectations in the second quarter.

Consumers were looking for its detergents and other cleaning goods, which drove up total and organic sales by 6% year over year. Net sales totaled $21 billion, thanks to a 3% increase in volume and a corresponding increase in product pricing.

While increasing material prices and pricey freight slashed gross margins by 4 percentage points, the company's flexibility and willingness to absorb higher pricing led it to raise its annual projection.P&G adds to tide of weak consumer goods results | Financial Times

The creator of Ariel and Oral-B now forecasts a 3% to 4% increase in sales in 2022, down from a previous prediction of 2% to 4%. The company also increased its organic sales growth target to 4% to 5% from 2% to 4% previously, a significant increase for a company of its scale at this point in the financial year.

Volumes in the healthcare sector increased by 4% in the second quarter, helping to drive an 8% growth in sales, the biggest among P&G's five core verticals, thanks to a 1% increase in prices. As the pandemic faded and seasonal flu took its place, demand for P&G's cough and cold medicines such as Vicks increased. Its toothpaste and whitening treatments were also in high demand.

In the personal healthcare business, each region saw double-digit organic sales growth for the quarter, according to P&G.