In the midst of the economic gloom afflicting so many Third World countries, Egypt is proving a notable exception and has just completed its most successful economic year in at least a decade and possibly modern times.

Egyptian and Western economists differ slightly in their assessments, yet they seem to agree that the turnabout in the chronic financial troubles of this nation of 42 million people has been remarkable.

Last year, Egypt added about $800 million to its foreign reserve holdings, which reached $1.5 billion, exceeded an 8 percent growth rate for the fourth straight year, curbed a galloping inflation rate that had reached 30 percent, posted an overall balance of payment surplus of $1 billion and ended with a balanced budget, albeit partly through a slight of hand in bookkeeping procedures.

For a country traditionally mired in poverty, excess population and debt, the sudden, relative prosperity is heady news, and officials are ebullient.

"You can say it's a year which we have not witnessed before," said Finance Minister Fuad Hussein in an interview. "We have increased our [financial] credibility and our credit worthiness."

With some caveats, Western economists, including those at the World Bank, concur.

"There has really been a dramatic turnaround," remarked one. "In 1973, it was all debt and no income . . . Now all the macroeconomic indicators are favorable."

Paradoxically, the "marco figures" being touted about by the government have provided little consolation to the vast majority of Egyptians, many of whom feel that President Anwar Sadat's promised "year of prosperity" in 1980 turned instead into a "year or catastrophe," as one opposition leader put it.

Inflation has eaten away at meager incomes, particularly those of the middle class led by government employes, whose average take-home pay amounts to $50 to $70 a month.

Many Egyptians are openly grumbling about the high cost of living and for the first time blaming their woes on Sadat and his policy of liberalizing the economy.

The squeeze was brought home to Egypt's poorest residents last year when the price of a round disk of bread, a key staple, doubled to about 1.5 cents.

"These are the untouchables of the economy," remarked one Western diplomat.

"It's the taking away of the last little bit of security blanket."

Just how sensitive Egyptians are to price changes in the "untouchables" -- bread, sugar, cooking gas, beans, and meat among others -- was illustrated in September. Unannounced, the government tried to double the cost of so-called "free sugar," which is sold at prices far above the subsidized level at the state stores.

By the end of the first day, the government lowered the price to 42 cents for a 2 1/2-pound bag of sugar after consumers threatened to riot.

Similar price increases in the "untouchables" that hit hard at the lower classes sparked the terrible riots in January 1977, which killed 79 persons and shook the Sadat government to its foundations. Memories of that experience remain vividly fixed in the minds of Egyptian economists and politicians, above all Sadat, causing them to reject Western proposals to raise the incredibly low prices on basic commodities to ease the heavy burden of subsidies on the government.

It is still possible for Cairo's ubiquitous street parking attendants to pay for two starchy bread-and-bean meals with the usual ten piasters, or about 18 cents, earned from looking after just one car. But the government last year paid $2.2 billion in subsidies to continue keeping prices low.

The key to the Egyptian "economic miracle" lies in sudden big returns from its relatively small oil wealth and the export of its human resources to richer neighboring countries. Reaping the full benefits of the 1979 world price increases, Egypt last year earned record oil profits of about $2.7 billion and expects to top $3 billion next year. This compares to $780 million three years ago.

Oil income has finally caught up to Egypt's single largest source of foreign exchange earnings for the past few years -- the payments sent home by 2 million Egyptians working aboard, mostly in the rich, Arab oil-producing countries of the persian Gulf and Libya. Workers "remittances," as they are called, last year provided the government with $2.7 billion, another record amount.

Together with its earnings from the Suez Canal ($650 to $710 million), tourism (around $700 million) and foreign loans and aid, led by slightly more than $1 billion from the United States, the government was able to more than cover the World Bank estimated $1.3 billion current account deficit resulting from the import of more goods than the value of Egypt's total exports.

Other good news on the economic front was announced in mid-January by Egypt's oil minister, Ezzeddin Hilal, who disclosed 12 new oil discoveries in the Gulf of Suez and the mouth of the Red Sea, at least doubling and possibly tripling the country's present modest oil reserves of 1 billion barrels.

Hilal was not immediately able to say how much these finds would add to the country's oil exports, presently averaging about 650,000 barrels a day. But the first confirmed discovery of oil in the Red Sea aroused hopes of even bigger finds in the near future.

Despite the heady atmosphere prevailing in official government, circles. Western economists say the long-term economic prospects for Egypt remain fraught with dangers and the underlying distortions in the economy still are urgently in need of correction.

With a million more Egyptians born every year, remarked one Western economist, "the main challenge facing the government is how to take advantage of their resources to be able to feed, cloth and house 60 to 70 million people by the year 2000."

Outside the oil sector and a few agricultural export corps such as cotton, the Egyptian economy is basically inefficient and unproductive. Egypt has no significant exports of industrial goods, and last year it imported 5 out of the 7 million tons of wheat it needed to keep its 42 million people alive. The cost to the government was $1 billion. Other food imports cost another $1.2 billion, according to the latest World Bank report on Egypt.

The bank, the International Monetary Fund and other outside donors such as the United States are pushing hard for basic economic reforms, particularly in the state-run industrial sector and in the system of costly food subsidies to nudge Egypt toward a more competitive, profit-oriented market economy.

President Sadat, however, has just promised Egyptians that 1981 will be the year of "social justice." This would include, he said, a new tax law to assure a fairer distribution of wealth, more price controls to cut back inflation to 10 percent, greater food security and efforts to resolve the chronic housing shortage that is the bane of young, middle-class Egyptians.

Just how these conflicting priorities of increased social justice and productivity are to be resolved remains to be seen. But Egyptian officials such as Finance Minister Hussein insist "political and social stability is the keystone of any economic development" and thus the costly social services and food subsidies that keep Egyptians from running rampant in the streets are fully justified.

"There s the need for some courageous political decisions somewhere along the line," said the Western economist pondering the problems that lie ahead. "They know the problems. There are no mysteries."

"The question is what are they doing to increase and prepare the base for sustained economic growth," he added. "You cannot eat or wear oil."