Secretary of Education T.H. Bell resigned yesterday, ending four years of what he called "a splendid misery."

"It's been an exciting four years," Bell said. "I think Winston Churchill was the first one to use the term 'a splendid misery.' But it's been more splendid than misery."

He said his major achievement was commissioning "A Nation at Risk," the comprehensive report on the state of education in America that made education a major national issue.

Failing to convince teacher unions of his "grave concern" that the teaching profession is in trouble, Bell said, was his most regrettable failure. Teaching, he said, is not drawing its fair share of top talent.

The last Cabinet member named in the first Reagan administration, Bell drove to Washington from Utah in a rented truck. He was charged with carrying out President Reagan's campaign promise to abolish the Department of Education.

Instead, Bell raised the department's profile, defined the state of education and established a leadership role for the federal government in education, even as the administration urged more state and local control.

In the process, he earned the respect of the education establishment but the enmity of political conservatives who have lobbied for less federal involvement in the nation's classrooms.

A moderate Republican and dedicated educator, Bell skillfully, if not comfortably, walked a political tightrope throughout his tenure, at times differing with administration positions but still managing to deflect criticism of Reagan's educational objectives by turning his dedication to his constituency to the president's political advantage.

His anticipated resignation, submitted to the White House Wednesday, cited "personal circumstances" and called the past four years the most "challenging and exciting" of his professional life.

"I leave my position feeling that we are in the midst of a lasting and meaningful academic renewal that will benefit millions of learners in our nation's schools and colleges," Bell said. He had not talked to the president, who is in California, but was awaiting a telephone call from the West Coast.

During Bell's term as secretary, the structure of federal education programs changed dramatically, with much of the department's aid to public schools being channeled through block grants, which give state and local officials greatly increased discretion.

But one the fondest wishes of conservatives, embodied in the Republican Party platform of 1980 but eliminated this year, was the abolition of the department. That goal was quietly abandoned in the weeks that followed the release of the excellence commission's report on public schools.

Through his appointment of the commission, which warned of a rising tide of mediocrity in education, Bell helped create and shape a nationwide groundswell of concern about the quality of schools.

Reagan, in effect, jumped on Bell's bandwagon, endorsing the report, which was released in April 1983, and giving 51 speeches on its themes.

All this represented a radical shift in the administration's policy that originally had three goals: abolish the Education Department (which was created by Congress when Jimmy Carter was president), offer tuition tax credits to families with children in private schools and permit prayers in public schools.

Bell testified in support of all Reagan's proposals for major cuts in federal education spending, but when Congress refused to go along with most of them, he did not seem disappointed. Shortly before the election Bell spoke proudly at a news conference about how much Education Department spending had grown, from $14.8 billion in fiscal 1981 to $18.3 billion for fiscal 1985.

In an interview last month with the Chronicle of Higher Education, Bell said he would "continue to persuade Office of Management and Budget Director David Stockman that education is such a high priority . . . that you have to put it alongside of national defense when you consider budget levels."

Politically, the result of Bell's efforts was to blunt attacks by education groups and Democratic presidential nominee Walter F. Mondale that Reagan was opposed to education.

The excellence commission report, and Bell's and Reagan's speeches after it, probably did add considerable impetus to state and local efforts -- already under way in many places -- to raise educational standards and quality.

In effect, this has meant a deemphasis of efforts to use education as a vehicle for social reform through desegregation or special programs aimed at low-income children, though in the past year Bell has spoken repeatedly about the need to reduce the number of high school dropouts.

Accompanied at a farewell news conference yesterday by his wife, Betty, and Peter, one of their two sons, Bell said he wanted to get back to the family business, a sod farm, which they started a year before he received the call from Reagan to go to Washington.

He said he left then, even though the business needed his personal attention, because "a strong ego overpowered a weak intellect and I just couldn't resist."

Bell, who will be 63 on Sunday, will teach in the University of Utah's School of Administration, he said, for the more than two years he needs to qualify for pension benefits.