The United States recorded its second-largest surplus ever in trade and other current financial transactions with the rest of the world during the third quarter of 1980, the Commerce Department reported yesterday.

A $4.9 billion surplus in the so-called balance on current account was the first surplus in a year and was surpassed only by a $5.1 billion surplus in the second quarter of 1975.

"The third-quarter surplus nearly brought the current account into balance for the first three quarters and virtually assures a current-account surplus for 1980," Commerce Secretary Philip M. Klutznick said.

Much of the big swing from the $2.4 billion deficit in the second quarter was due to a drop in oil imports and a large increase in the value of agricultural exports. Those two factors contributed to a drop in the U.S. merchandise trade deficit from $7.5 billion in the second quarter to $2.8 billion in the July-September period.

In addition to merchandise trade, the current account includes transactions in servcies, tourism, income from direct investments in other countries, pension payments to foreigners and private remittances. It does not include long-term capital investments.

While merchandise trade, for which figures are available monthly, is more highly publicized, most economists regard the current account as the best measure of whether a country's transactions with the rest of the world are in balance.

The fact that the United States' current account is in surplus, for instance, is one reason for the dollar's continuing strength on foreign exchange markets. Conversely, the growing current-account deficit in West Germany has contributed to the weakness of the German mark. A current-account surplus means, in effect, a country is earning more abroad than it is paying out.

There was also a deficit of $1.5 billion in unilateral transfers, that is, U.S. government grants and pension payments, private remittances and other such transfers.

Offsetting deficits in those two areas was a $9.2 billion surplus in services. These services range from engineering or insurance to royalties on films to income from direct investments abroad by Americans.

There was a $2.2 billion improvement in net U.S. income from direct investments abroad during the third quarer, as total income from that source reach $10.1 billion while payments on such investments in the United States rose only to $3.1 billion.