The cost of the congressional and criminal investigations into the Iran-contra affair has exceeded $4 million and is expected to go higher, spokesmen said yesterday.

The investigations, which began in January, reached the $4 million mark last month, but the total does not include extras such as guards at the House-Senate hearings, which ended last week, architectural costs for building a special rostrum for the hearings and printing the voluminous transcripts from 11 weeks of hearings.

Robert Havel, a spokesman for the House select investigating committee, said that as of July 31 the House panel had spent $959,000, including salaries for 45 staffers, stationary, equipment, travel, telephones and other incidentals.

The panel, which has a $1.95 million budget for its investigation, is expected to spend the "bulk of the money" by the time the committees finish their work and issue a final report in October, Havel said.

Officials for the Senate Iran-contra panel said that it had spent $1.2 million as of June 30 for a staff of 52 and to pay for similar expenses incurred by the House committee. The Senate panel has projected its final cost at $2 million.

The highest paid employe on the Senate committee is Arthur L. Liman, chief counsel for the Senate, who took a leave of absence from his New York law practice. His yearly salary would be $72,676, although he is likely not to stay with the committee for an entire year.

No salary was available for Liman's House counterpart, John W. Nields Jr., but spokesman Havel said Nields is being paid at an hourly rate of $100.

Independent counsel Lawrence E. Walsh, who is conducting a criminal probe, has spent $1.8 million as of June 30 for his criminal investigation into the secret sale of U.S. arms to Iran and the diversion of profits to aid the Nicaraguan contras.

Those figures include salaries for 29 lawyers, 35 Federal Bureau of Investigation agents, 11 Internal Revenue Service agents, 6 Customs Service agents and 73 administrative personnel. In addition, Walsh's office is spending $59,808 for a yearly lease on a downtown Washington office, according to a spokesman.

Walsh's costs are expected to go much higher if there are indictments and prosecutions in the case.

In other costs, the architect of the Capitol spent $200,000 to equip the offices for the Senate staff on the top floor of a Senate office building. That work included a bug-proof room with "elaborate gear," according to William Raines, an aide to the Capitol's architect.