
337 S.E.2d 737 (1985)
RICHLANDS MEDICAL ASSOCIATION
v.
COMMONWEALTH of Virginia, ex rel. STATE HEALTH COMMISSIONER, et al.[1]
Record No. 841579.
Supreme Court of Virginia.
November 27, 1985.
*738 R. David Barbe (Gregory L. Lyons, Roanoke, Virginia H. Hackney, Matthew D. Jenkins, Richmond, Gardner, Moss & Rocovich, P.C., Roanoke, Hunton & Williams, Richmond, on briefs), for appellant.
John A. Rupp, Senior Asst. Atty. Gen., Thomas W. McCandlish (Gerald L. Baliles, Atty. Gen., Karen A. Laserson, Asst. Atty. Gen., Barrett E. Pope, Mezzullo, McCandlish & Framme, Richmond, on briefs), for appellees.
Present: All the Justices.
STEPHENSON, Justice.
In this appeal, we consider the nature and scope of a mandamus proceeding.
In May 1981, Richlands Medical Association (RMA) submitted an application to the State Health Commissioner, pursuant to the provisions of former Code §§ 32.1-93 to *739 32.1-102, inclusive,[2] for a certificate of need (the "certificate") to construct a new hospital in Richlands. After various administrative proceedings, the Commissioner denied the application. RMA appealed the Commissioner's determination to an independent hearing examiner designated by the Governor. See former Code § 32.1-97. After reviewing the record and taking additional evidence, the hearing examiner found that the Commissioner exceeded his discretion in evaluating the evidence, reversed the Commissioner's decision, and directed that the certificate be issued to RMA.
Thereafter, the Commissioner filed with the trial court a petition for a writ of mandamus. The petition requested the court to issue a writ ordering the hearing examiner "to adhere to the law, to interpret properly the ... Certificate of Public Need Law, to restrict his review to the function specified in [Code] § 32.1-97 ..., to abandon his erroneous construction of the law, and to affirm the ... Commissioner's original denial of the application...."
RMA contended at trial, as it does here, that mandamus does not lie. The trial court rejected this contention, reasoning that "[t]he interpretation of a statute is a ministerial act" subject to a writ of mandamus. The trial court granted appellees' writ of mandamus, vacated the hearing examiner's decision, and affirmed the Commissioner's determination. Although RMA's assignments of error raise a number of issues, the dispositive issue in this appeal is whether the trial court erred in holding that mandamus was a proper remedy and in issuing a writ of mandamus.
Mandamus is an extraordinary remedy employed to compel a public official to perform a purely ministerial duty imposed upon him by law. Richmond-Greyhound Lines v. Davis, 200 Va. 147, 152, 104 S.E.2d 813, 816 (1958). A ministerial act is "one which a person performs in a given state of facts and prescribed manner in obedience to the mandate of legal authority without regard to, or the exercise of, his own judgment upon the propriety of the act being done." Dovel v. Bertram, 184 Va. 19, 22, 34 S.E.2d 369, 370 (1945).
When a public official is vested with discretion or judgment, his actions are not subject to review by mandamus. Id. As we stated in Thurston v. Hudgins, 93 Va. 780, 20 S.E. 966 (1895):
[I]t is well settled that mandamus will not lie to compel the performance of any act or duty necessarily calling for the exercise of judgment and discretion on the part of the official charged with its performance....
"[W]here the official duty in question involves the necessity on the part of the officer of making some investigation, and of examining evidence and forming his judgment thereon" mandamus will not lie.
93 Va. at 783, 20 S.E. at 967-68 (citations omitted).
The function of a trial court in a mandamus proceeding is to "command and execute, and not to inquire and adjudicate." Railroad Co. v. Fugate, 206 Va. 159, 164, 142 S.E.2d 546, 550 (1965). Indeed, a trial court exceeds its function and usurps the authority granted to a public official when it undertakes in a mandamus proceeding to review the discretion of the official. Broaddus v. Supervisors, 99 Va. 370, 372, 38 S.E. 177, 178 (1901).
One of the marked characteristics of a proceeding by mandamus is that if the functionary whose conduct is complained of is by law to exercise any discretion, that discretion will not be controlled by a writ of mandamus; for that would be to transfer the discretion which the law commits to the functionary to the court which undertakes to award the writ.
*740 Id. at 372, 38 S.E. at 177-78; see Funeral Directors' Ass'n v. Groth, 202 Va. 792, 797, 120 S.E.2d 467, 471 (1961) (mandamus will not lie to control manner in which public official exercises discretion).
Additionally, mandamus is applied prospectively only; it will not be granted to undo an act already done. Board of Supervisors v. Combs, 160 Va. 487, 498, 169 S.E. 589, 593 (1933); Thurston, 93 Va. at 784, 20 S.E. at 968.
Finally, the extraordinary remedy of mandamus may not be used as a substitute for an appeal. See Moon's Administrator v. Wellford, Judge, 84 Va. 34, 4 S.E. 572 (1887). Mandamus "lies to compel, not to revise or correct action, however erroneous it may have been, and is not like a writ of error or appeal, [which is] a remedy for erroneous decisions." Combs, 160 Va. at 498, 169 S.E. at 593.
The hearing examiner's powers and duties were prescribed in former Code § 32.1-97:
The hearing examiner shall review the record and any additional evidence presented on behalf of the parties to the appeal. The review of the hearing examiner shall be limited to (i) whether there was substantial procedural compliance and (ii) whether the Commissioner exceeded his discretion in evaluating the evidence presented. The hearing examiner shall take due account of the presumption of official regularity, the experience and specialized competence of the Commissioner, and the purposes of the Medical Care Facilities Certificate of Public Need Law.
Clearly, former Code § 32.1-97 granted the hearing examiner wide discretion. He was authorized to evaluate the evidence from a review of the record. He also was authorized to take and consider additional evidence. The purpose of his review was to determine "whether the Commissioner exceeded his discretion in evaluating the evidence presented." Thus, the hearing examiner was required to make a judgment in determining whether the Commissioner exceeded his discretion. Manifestly, the hearing examiner was not performing a ministerial act; he was discharging a quasi-judicial duty, weighing conflicting evidence, interpreting law, and applying law to facts. See Rowe v. Drisgell, 100 Va. 137, 40 S.E. 609 (1902); Thurston, 93 Va. 780, 20 S.E. 966 (1895). Cf. Lewis v. Christian, 101 Va. 135, 43 S.E. 331 (1903). Because the hearing examiner's duties required the exercise of judgment and discretion, mandamus will not lie.
Furthermore, the record discloses that the Commissioner in effect sought from the trial court by way of mandamus a judicial review of the entire administrative proceedings. The trial court conducted a comprehensive judicial review and granted the relief requested by the Commissioner. In so doing, the trial court substituted its judgment for that of the hearing examiner. This may not be done by mandamus.
Finally, the trial court issued the writ of mandamus to undo acts already done by the hearing examiner. As we stated previously, mandamus applies prospectively only; it may not be used to revise the hearing examiner's completed acts.[3]
We hold, therefore, that the trial court erred in ruling that mandamus would lie in this case and in granting the writ. Accordingly, we will reverse the judgment of the court, vacate the writ, and dismiss the petition.
Reversed, writ vacated, and petition dismissed.
NOTES
[1]  The other appellee is Humedicenters, Inc., d/b/a Clinch Valley Community Hospital, Inc., which began operating a new 200-bed hospital in August 1983, to serve the people of Richlands and the surrounding area. Its contentions and arguments in this appeal are essentially the same as those of the State Health Commissioner.
[2]  These sections have been repealed, Acts 1982, ch. 388, and were replaced by Code §§ 32.1-102 to 32.1-102.11, inclusive (1985 Repl.Vol.).
[3]  For this reason, it is unnecessary for us to consider whether the hearing examiner had the authority to direct the issuance of the certificate.
