
431 Pa. 233 (1968)
Rose Tree Media School District, Appellant,
v.
Department of Public Instruction.
Supreme Court of Pennsylvania.
Argued May 22, 1968.
August 13, 1968.
*234 Before BELL, C.J., MUSMANNO, JONES, COHEN, EAGEN, O'BRIEN and ROBERTS, JJ.
*235 George W. Thompson, with him Baile, Thompson & Shea, for appellant.
Warren G. Morgan, Deputy Attorney General, with him William C. Sennett, Attorney General, for appellees.
OPINION BY MR. JUSTICE COHEN, August 13, 1968:
This is a mandamus action instituted by appellant, Rose Tree Media School District, to compel appellees, the Department of Public Instruction, the State Treasurer, and the Auditor General to pay an alleged $21,601.25 deficiency due appellant on account of reimbursement for pupil transportation costs for the years 1958-59 through 1964-1965.
Appellees filed a preliminary objection to the complaint averring that appellant failed to state a cause of action. The court below, after argument, sustained the objection and dismissed the complaint. This appeal followed.
The principal issue for our determination is whether or not the refusal of the Superintendent of Public Instruction to reimburse a school district for pupil transportation costs under the Public School Code of 1949, Act of March 10, 1949, P.L. 30, as amended, 24 P.S. §§ 25-2541-43 is a proper subject for an action of mandamus. In order to resolve this issue, it is necessary to determine whether the Superintendent of Public Instruction has mandatory or discretionary powers with respect to the payment of reimbursable transportation costs actually incurred by the school district. The law is clear that mandamus will only lie to compel public officials to perform their duties in accordance with the law when those duties are ministerial in character and not discretionary. Volunteer Firemen's Relief Association v. Minehart, 415 Pa. 305, 203 *236 A. 2d 476 (1964); Meadville Area School District v. Department of Public Instruction, 398 Pa. 496, 159 A. 2d 482 (1960); Mellinger v. Kuhn, 388 Pa. 83, 130 A. 2d 154 (1957); Maxwell v. Farrell School District Board of Directors, 381 Pa. 561, 112 A. 2d 192 (1955); Dechert, Controller of the City and County of Philadelphia v. Commonwealth, 113 Pa. 229, 6 Atl. 229 (1886); 17 McQuillin, Municipal Corporations § 51.16 (3d ed. 1968). A ministerial act has been defined as one which a public officer is required to perform upon a given state of facts in a prescribed manner in obedience to the mandate of legal authority. See Meadville Area School District v. Department of Public Instruction, supra; 17 McQuillin, Municipal Corporations, supra, § 51.19. In our view, the Public School Code of 1949, as amended, provides a mandatory statutory directive for the Department of Public Instruction to follow. Section 2543 provides: "On or before the first day of July of each year, each school district entitled to reimbursement on account of public transportation shall present to the Superintendent of Public Instruction in such form as he may prescribe and on blanks to be furnished by him, a sworn statement of the amount expended during the previous school year for reimbursable transportation of pupils to and from school, and any amount expended during the previous school year for board and lodging in lieu of reimbursable transportation. On the basis of such statement, the Superintendent of Public Instruction shall, by requisition upon the State Treasurer, pay, during the month of September, to such school district, such reimbursement for the previous school year as is provided for in this act. The Department of Public Instruction may, for cause specified by it, withhold such reimbursement, in any given case, permanently, or until *237 the school district has complied with the law or regulations of the State Board of Education." (Emphasis supplied). The procedure for reimbursing pupil transportation costs incurred by a school district for the previous school year is outlined under § 2541 wherein the statute reads: "School Districts shall be paid by the Commonwealth for every school year on account of pupil transportation which, and the means and contracts providing for which, have been approved by the Department of Public Instruction, in the cases hereinafter enumerated, an amount to be determined by multiplying the cost of approved reimbursable pupil transportation incurred by the district by the district's aid ratio. . . ." It is clear from reading these statutory requirements that once the department has approved the amount of reimbursable transportation costs, there is no discretion left to the department in arriving at the actual amount which must be paid to the school district. After approval, the department is mandated by the statute to remit an amount which is to be determined by applying the mechanical formula of multiplying the cost of the approved reimbursable pupil transportation incurred during the school year by the district's aid ratio. The application of that formula does not involve any discretion but merely involves the ministerial duty of making the proper computations in accordance with the directives of the statute. In the event that the Department approves the expenses incurred, its failure to pay the amount required by the formula is a proper subject for an action of mandamus. Since, according to appellant's complaint in mandamus, the Department has exercised whatever discretion, if any, it has in approving the cost figures submitted by the school district, the court below erred in holding that the complaint failed to state a proper *238 cause of action.[1] In Meadville Area School District v. Department of Public Instruction, supra, we held in an analogous situation involving an interpretation of §§ 25-2572, 25-2574 (reimbursement for school building projects), that the Department may or may not have discretion with respect to the figures used in applying the statutory formulas, but once those figures have been approved, mandamus will issue to compel the Department to perform its ministerial duty of mechanically computing the actual reimbursable amount. Although different sections of the Public School Code are involved in the instant case, nevertheless, we believe that the reasoning and analysis in Meadville dictates that appellant's complaint is sufficient to withstand appellee's preliminary objection in the nature of a demurrer.
Appellees argue that even if the complaint states a cause of action, appellant would be precluded from recovering on the basis of the defense of laches. In this regard, we find it unnecessary to reach the merits of this contention, since the defense of laches cannot be brought before the court by way of preliminary objections,[2] but must be raised as an affirmative defense in *239 a responsive pleading under the heading "New Matter." See Pa. R.C.P. 1030.
Judgment reversed and case remanded with instructions to reinstate the complaint.
CONCURRING OPINION BY MR. JUSTICE ROBERTS:
The decision of the majority is bottomed on the proposition that once appellees have approved appellant's pupil transportation costs, there is nothing further for the Department of Public Instruction to do except plug these costs into a pre-set formula and disburse the funds. I agree that these last two acts are ministerial only, and a failure to perform them would support an action of mandamus.
Of course, since approval of the costs themselves is discretionary, mandamus would not lie to compel the Department to approve the exact figures submitted by the school district. Accordingly, to withstand preliminary objections in this case it was necessary for appellants to allege in their complaint that the figures submitted to the Department by the school district had been approved. In my view, paragraph 6 of appellant's complaint, containing this allegation, is somewhat ambiguous. The complaint merely says that the Department "approved the reimbursable pupil transportation." However, it never appears whether the figures eventually approved were those originally submitted by the school district or were, in fact, altered figures ascertained by the Department.
Since the thrust of appellant's complaint is that they have received less than they would have gotten *240 had the formula been applied to their own submitted figures, relief in mandamus must eventually depend on whether this lesser amount actually resulted from an arbitrary misapplication of the formula to appellant's figures, or from a correct application of the formula but to some other set of figures, approved only after the Department, in its discretion, had changed appellant's original submitted costs. If the latter situation should prove true, in my view mandamus would not be proper.
I therefore concur in the majority's holding that preliminary objections should not have been sustained simply because the language in paragraph 6 is broad enough to be read as an allegation that the figures approved were indeed those submitted by the school district. If the Department, however, should allege that appellant's figures were not the ones approved, then of course an issue will have been joined, the proper resolution of which may determine the eventual outcome of this litigation.
Mr. Chief Justice BELL and Mr. Justice EAGEN join in this concurring opinion.
NOTES
[1]  In paragraph 6 of appellant's complaint in mandamus it is averred: "In each case, the applications set forth the cost of reimbursable pupil transportation within the District for the applicable school year. In each case, the Department of Public Instruction approved the reimbursable pupil transportation. Notwithstanding this, and in each case, the Department of Public Instruction arbitrarily reduced the reimbursement payable and remitted lesser amounts as above set forth." (Emphasis supplied). Therefore, we have assumed for the purpose of writing this opinion that the Department has already approved the reimbursable pupil transportation costs and has arbitrarily remitted lesser amounts than requested by appellant.
[2]  The record fails to indicate that the defense of laches was raised by appellees in their preliminary objections. In fact, the record discloses that the only formal preliminary objection raised was the motion to dismiss for failure to state a cause of action. In light of the foregoing, as well as the improper procedure used to raise the defense of laches if in fact it were raised by preliminary objections, compels us to remand the case without reaching the merits of the defense.
