BANGALORE, Nov 6 (Reuters) - Headwaters Inc, which makes building materials, coal combustion products and alternative energy, posted better-than-expected quarterly earnings on improved performance across all its business segments, sending shares up about 7 percent.

Excluding a goodwill impairment charge of $98 million, the South Jordan, Utah-based company reported fourth-quarter earnings of $27.5 million, or 59 cents a share, which beat analysts' estimates by 7 cents.

Total revenue rose 17 percent to $322.5 million.

Analysts were expecting $302.5 million, according to Reuters Estimates.

The company's shares, which were down 45 percent so far this year, rose 90 cents to $14.05 in afternoon trade on the New York Stock Exchange.

However, including the charge, Headwaters posted a net loss of $70.5 million, or $1.67 a share, compared with net income of $28 million, or 61 cents a share, a year ago.

The company said it wrote down goodwill related to Tapco Holdings, which it acquired in 2004 and is a unit of its construction materials segment, due to the depressed residential housing and remodeling markets, and changes in valuation assumptions.

RIDING ON ACQUISITIONS

Construction materials business, which accounts for about half of the company's revenue, showed some improvement during the quarter with revenue rising 0.4 percent to $150.2 million, after having declined for the first three quarters of fiscal 2007.

In a statement, the company said its niche strategy offset the impact of the severe slowdown in new residential construction on its revenue.

The niche strategy includes buying small companies and integrating them into the company's construction distribution system, Headwaters spokesperson Sharon Madden said in an e-mail to Reuters.

Headwaters has completed several acquisitions in the building products industry over the past five years, generating more than $850 million in revenue in fiscal 2006, according to the company's Web site.

During fiscal 2006, it acquired five small companies and introduced four new product lines.

The company could go in for more acquisitions in both the energy technology and the building materials space, John Quealy, an analyst with Canaccord Adams, said by phone.

The alternative energy segment continued its strong performance with revenue almost doubling to $80.4 million.

Revenue from coal combustion products rose 10 percent to $91.9 million, on strong demand and upward pricing trends in several markets, the company said.

Quealy, who has a hold rating on the stock, said the alternative energy segment would see much faster growth compared to the construction materials segment in the near term.

OUTLOOK

For fiscal 2008, the company expects earnings to be between 95 cents and $1.35 a share, including about 30 cents a share from its alternative energy segment.

Analysts were expecting $1.16 a share.

The company said it expects continued growth in its coal combustion products business, but it does not see improvement in new residential construction and remodeling markets in 2008.

The report was better than expected, outlook is in line with the Street and organic growth opportunities are now getting mature enough to be included in the earnings guidance, Quealy said.