Two of the country's largest chemical companies, Celanese Corp. and Olin Corp., announced yesterday that they had reached an "agreement in principle" to merge.

The approximately $600 million transaction would be accomplished through a $30 per share cash offer by celanese for up to 30 percent of Olin's 24 million shares, with the remaining shareholders receiving an exchange of 0.375 shares of Celanese common and vertible preferred security.

If it gets the necessary approvals, the merger would create a highly diversified chemical company with combined sales - based on last year's figures - of $3.8 billion. That would rank it 55th on Fortune magazine's list of the 500 largest industrial companies.

It would be the fifth largest U.S. chemical company overall, ranking behind Du Pont, Union Carbide, Dow and Monsanto.

But while both companies are in the chemicals business, there is very little overlap - if any - in their product lines, clearly something the companies considered in light of potential antitrust problems.

A spokesman for the Justice Department's Antitrust Division said that either his agency or the Federal Trade Commission definitely will take a look at the proposed merger, but that no decision has been made as to which one will do it.

"It's a vert unusual match," commented Fred Siemer, a chemical industry analyst with F. Eberstadt and Co. "If the Celanese - Olin merger is consummated, it will not only be a very large chemical company, but one with a wide product mix from fibers to chlorine."

Celanese specializes in organic chemicals, particularly synthetic fibers, which last year accounted for 56 percent of the company's $2.32 billion in total sales. Other production includes raw organic chemicals such as acetic acid, plastics such as melamine and special polymers used to coat the inside of beer and soft-drink cans.

Celanese earings in 1977 totaled $70 million, up only one percent from the year before and continuing to reflect a soft worldwide fibers market. For the first six months of 1978, the company earned $42 million - up 17 percent for the period - on $1.27 billion in sales.

Olin, on the other hand, specializes in inorganic chemicals such as chlorine and industrial phosphates. It also has a substantial brass division, a specialized paper and cellophane group and the Winchester group which mainly makes rifles and ammunition for sportsmen.

Olin's sales last year totaled $1.47 billion, on which it earned $137 million, making it nearly four times as profitable as Celanese for each dollar of sales.

Olin, however, has had some profit problems in 1978 as a result of a three-month strike at one of its biggest plants, low demand for a number of its products, and work stoppages last winter related to poor weather and the coal strike.

Olin, meanwhile, has had its share of problems in other areas this year.

Last March, the company and three former officials were indicted on federal charges of concealing the dumping of 38 tons of mercury into the Niagara River at Niagara Falls over a seven-year period.

In March, the company pleaded no contest to charges that is had conspired to ship about 3,200 rifles to South Africa, in violation of the U.S. Neutrality Act of 1963 which prohibits domestic firms from selling weapons to that country because of its apartheid policy.

Yesterday's merger announcement is still subject to approval by both boards of directors, execution of definitive merger agreement, proper filings with federal agencies and approval of the shareholders of the two companies. Special meetings of the boards of each company are scheduled tomorrow.

On the New York Stock Exchange, Olin Corp. jumped 5 3/8 to 24 1/4, and Celanese was down 3 1/8 to 43.