The Census Bureau's undercounting of the nation's population, particularly large numbers of blacks and Hispanics, violates the Constitution, a federal judge ruled yesterday.

U.S. District Court Judge Horace W. Gilmore, ruling in a suit brought by the city of Detroit, barred the Census Bureau from reporting 1980 population figures until statistical adjustments are made for persons who were not counted.

Census officials said compliance with the ruling could delay by months reporting of official population figures, now scheduled for early next year. That could force postponements in reappointment of Congress.

Federal attorneys yesterday were reviewing the judge 41-page opinion, which reached deep into American history to the Constitutional Convention. They said they had not yet decided whether they would appeal the order.

Detroit Mayor Coleman Young and the mayors of other big cities with large black and Hispanic populations were exuberant about the decision. They have been battling the federal government for years, complaining that the undercounts had denied them congressional representation and cheated them out of federal funds distributed on the basis of formulas calculated from census figures.

Estimates are that more than $50 billion in federal funds for state and local housing, jobs and other programs are divvied up this way each year. In addition, the states return gasoline and tobacco tax revenue to cities and towns and draw state legislative districts using census data.

Some researchers, suggesting that the undercount may be spread more or less evenly across the country, question whether adjustments of the census would result in significant differences in the way the pie is sliced.

But Young and other mayor's of the financially hard-pressed older cities believe they do lose money and are adamant about getting the most accurate count possible. Many, if not most, know that they are certain to lose population anyway in the 1980 census to growing cities of the Sun Belt.

Young had contended that 67,000 people in Detroit were missed by counters in the 1970 census -- an error, he said, that caused the city to lose about $52 million in federal and state grants during the last decade.

Preliminary statistics released by the Census Bureau last month confirmed Detroit's worst fears about

Disputes about undercounts have plagued the census since the first one was taken in 1790. George Washington is said to have complained that thousands of people were missed. But this year's count has prompted an unusal number of lawsuits.

Young filed his complaint the day after the census began. D.C. Mayor Marion Barry and the mayors of Cleveland, Atlanta, Boston, Milwaukee, New Orleans, Paterson, N.J., and other cities filed briefs in the case alleging similar problems. An array of other lawsuits were filed by Philadelphia, New York, the state of New Mexico and others.

No one, not even the Census Bureau, disagrees that thousands of people are overlooked. Studies by Census and the Urban League of the 1970 count determined that an estimated 5.3 million people, about 2.5 percent of the population, were overlooked. The research indicated that about 7.7 percent of blacks were missed, compared with about 1.9 percent of whites.

The Census Bureau spent more than a billion dollars this year, about 4 times as much as in 1970, adding aggressive advertising compaigns to its budget to get fuller participation. Even so, officials acknowledge that there still undoubtedly were undercounts, particularly of blacks and Hispanics.

One issue in Young's suit was whether the Census Bureau could add statistical estimates of the numbers of people missed to census totals without running afoul of the Constitution's requirement that there be an "actual enumeration" every 10 years of the numbers of people in the country.

Gilmore ruled that the bureau could, saying that the Constitution does not require an actual headcount but rather the most accurate census that can be made.

"The defendant's contention that the Constitution requires solely a head count, unadjusted for the differential undercount, rings hollow," Gilmore said.

"The right to vote and the right to equal weight of vote is a cherished right essential to a democratic society and can be abrogated at much through dilution as through denial," he said. "The Constitution has long been interpreted so that not only does an individual have the right to vote, but also the right to have his or her vote counted."

Gilmore also brushed asided the federal government's argument that calculating the undercount would cause the bureau to miss deadlines set by Congress to report population figures for states for Jan. 1 and for cities and towns by April 1.

Nor was he impressed with arguments that it could lead to the postponement of congressional reapportionment.

"It is obvious that congressional reapportionment cannot be accomplished before the 1982 primary and general elections," he said. "There is no absolute need to have accurate census figures for reapportionment until the latter part of 1981, of the early part of 1982."

Census officials said that if they used simple, rough techniques -- one Census Bureau Statistician called them "cheesy" methods -- they might be able to compile estimates by late spring for the undercount of blacks and whites, but not Hispanics, for whom there is little historical information on which projections can be made.

Estimating the number of Hispanics missed and making sophisticated calculations of overlooked blacks and whites in the thousands of cities and towns around the country could take until 1982, said Jacob Seigel, senior statistcian in the population division of the Census Bureau.

"This is on the frontier of research. No one has done it," Seigel said.

Gilmore said he believes the Census Bureau can make accurate adjustments. He noted that, in 1970, 4.9 million people added to the count on the basis of postal information and other evidence that people were living in housing thought to be vacant. The statisticians argued in court, and again yesterday, that the task dictated by the opinion is far more complex.