Last-minute shopping helped bring the nation's retailers out of their holiday doldrums this week, as cash registers rung up stronger-than-expected sales for the last four days before Christmas.

After sluggish business earlier this month, retailers were in good cheer yesterday, heartened by the Christmas Eve spending surge.

Even so, most merchants here and around the country said they do not expect major gains in their profits this year.

Much of the sales activity in the last few days came from sharply marked-down goods as retailers offered one promotion after another in an effort to increase business. As a result, financial analysts predict most retailers will see little, if any, increase in their profits for the last part of the year.

"Retailers had to buy the business and they did," said Monroe H. Greenstein, a Bear, Stearns & Co. analyst. Consequently, "many retailers will show lower earnings and some of these declines will be pretty substantial."

Despite record sales days at Sears Roebuck & Co. and J. C. Penney Co. over the weekend, analysts still predict both chains will probably see a drop in profits, compared with the same period last year.

For other stores -- especially department stores -- "the exception will be those with a year-to-year gain in profits," predicted Stacy Ruchlamer of Shearson/Lehman American Express Co. "Most earnings will be flat with 1983 figures down slightly."

Analysts predicted the heavy promotions begun in December will continue through the month of January, when most retailers close their yearly financial records.

"January will continue to be a very promotional month," Ruchlamer said. "Retailers still have a lot of inventory they want to get rid of by the end of the fiscal year."

Even after January, however, heavy markdowns are likely to continue, analysts and retailers added. "Retailers have spent the last 15 years teaching American consumers to buy on sale and American consumers have learned," said Edward Weller of E. F. Hutton.

"I think the sale mentality is here to stay," added Michael Lavington, chairman of Kay Jewelers Inc. of Alexandria. "What that means, however, is that the initial mark-ups retailers make in pricing their goods will be that much higher. Retailers will just be marking up more to withstand the necessary markdowns. Consumers will not get much better bargains."

For Kay Jewelers, this year's Christmas was not the best. "It was an okay month -- not what I call a good December, but it wasn't a bad one either," Lavington said.

Retailers who slashed prices reported sharp gains just before Christmas. A spokesman for Allied Stores Corp., the parent of Garfinckel's, Brooks Brothers and Miller & Rhodes Inc., said all of the company's stores reported a very strong sales finish on Saturday, Sunday and Monday. The markdowns, he added, "certainly were very heavy."

At W. Bell & Co., the season was "salvaged by the last 7 to 10 days of sales," said Martin Pfeifer, vice president of finance. "Prior to that the sales were on the soft side . . . We did do a little bit more promotion" than planned, Pfeifer added. As a result, "I do think they'll be a little bit of erosion in profits."

Sears, which also launched heavy promotions after sluggish sales earlier in the month, reported record sales for the Saturday and Sunday before Christmas, leading the company to a modest increase in sales for December. Earlier this month, the nation's largest retailer had been predicting a drop for the month.

Penney's, the nation's third-largest retailer, also reported record sales last weekend as the result of heavy promotions. "Christmas turned out real well," said William Striegl, district manager for Penney's stores in the area.

"The last three days, most stores recorded the biggest sales they ever had in any one day. Yet because of our markdowns and warm weather, profits, as a percent of sales, will be less than last year."

Retailers all blamed the warm weather for the lackluster sales, especially of apparel. Ruchlamer noted also that consumers were not that excited about this year's fashions. "There was nothing new and exciting . . . it was lackluster, with no new trends."

But perhaps even more significant, this year's sales figures show a new trend by American shoppers: "The consumer is just taking a rest. With pent-up demand satisfied, consumers are now shopping closer to the time they need goods than they have in the past," Ruchlamer said.

Not all retailers did poorly. While most were saying sales increases would be around 5 percent to 8 percent above last year, Hecht Co. Chairman J. Warren Harris said his firm would report an increase of between 12 and 14 percent.