BALTIMORE -- Most of Maryland's 68 banks improved their already strong financial conditions in the fourth quarter of last year, according to the latest survey of the nation's 13,786 commercial banks by IDC Financial Services.

The latest issue of the Bank Financial Quarterly, which used data reported to the Federal Deposit Insurance Corp. for the last quarter of 1986, shows that Maryland's average bank rating rose enough to put the state average in the "excellent" category, significantly higher than the national average.

IDC gave 19 Maryland banks "superior" ratings. Thirty-four got "excellent" ratings for the quarter that ended Dec. 31.

The financial strength of Maryland banks is due "in part to prudent management" and in part to luck -- "where you happen to be located," said Kyle P. Legg, a bank analyst with Alex Brown & Sons in Baltimore.

Generally, Maryland banks have a much lower number of delinquent loans and charge-offs than those in other regions. Legg noted that the combined Maryland, Virginia and District of Columbia market is economically stable.

Problem banks are concentrated in the Midwest, where the farm crisis has damaged many agriculture loan portfolios. Oil states also have suffered, delaying loan paybacks to banks in those areas.

IDC gave 363 banks its lowest rating and 2,484 its highest.

Maryland's top banks included Mercantile Bankshares, with a "superior" rating, and Maryland National Bank's parent company, MNC Financial, and First Maryland Bancorp, which each posted an "excellent" rating. There were no Maryland banks in the "below average" category and only six in IDC's "average" category.

The study considered factors such as capital risk, loan and deliquency mixes, profitablity and flexibility.