The Public Health-Department of the North Carolina Department of Health and Human Services (“DHHS”) appeals from order entered by the superior court, which reversed the decision of the State Personnel Commission (“SPC”). We reverse and remand.
I. Background
In the Spring of 2005, sixty-two-year-old Dr. Alma Chinita Trotter (“Dr. Trotter”) applied for a full-time Educational Diagnostician II position opening posted by DHHS (“the position”). The position was to be located in the Raleigh office for the Child Developmental Services Agency (“CDSA”), a subdivision of DHHS.
The application and review process is described in the record. Applications received by DHHS are sent to the Human Resources office where a personnel technician enters the applicant’s name and other information into the Applicant Tracking System (“ATS”). The technician forwards the applications and an applicant log that contains Equal Employment Opportunity (“EEO”) information to a recruitment coordinator.
The recruitment coordinator reviews the applications, screens the applicants for “minimum qualifications” based on the “Training and Experience” requirements listed in the posting, and indicates *657whether the applicant is qualified on the applicant log. The applications and the applicant log are returned to the personnel technician. The technician enters the new information into the ATS and generates an Applicant Selection Log. The Applicant Selection Log lists qualified applicants without disclosing their EEO information.. The Applicant Selection Log is sent to the hiring manager.
Hiring manager Timothy C. Pritchard (“Pritchard”) received the Applicant Selection Log from the personnel technician, which listed Dr. Trotter and seven other applicants as qualified by the human resources staff. Pritchard interviewed two internal applicants listed on the Applicant Selection Log that he also determined to be qualified. Pritchard recommended thirty-seven-year-old internal applicant Evangeline Seay (“Seay”) for the position in the Raleigh CDSA office.
Pritchard indicated that he believed Dr. Trotter had “sufficient experience but less than the selected candidate.” On 27 June 2005, the DHHS recruitment staff sent a rejection letter to Dr. Trotter regarding the position. Dr. Trotter contacted Pritchard to discern why she did not receive an interview. Pritchard told Dr. Trotter that a candidate currently working for DHHS possessed the qualifications and was a better fit for the position.
On 26 July 2005, Dr. Trotter filed a petition for a contested case hearing pursuant to N.C. Gen. Stat. § 126 and alleged she had been discriminated against based on race, sex, and age. On 1 June 2006, the Administrative Law Judge (“ALJ”) filed its decision, which concluded DHHS did not discriminate against Dr. Trotter. In an opinion and award filed on 14 September 2006, the SPC adopted the AU’s decision and findings of fact. On 14 October 2006, Dr. Trotter appealed to the superior court pursuant to N.C. Gen. Stat. § 150B-45.
On 2 May 2007, the superior court reversed the SPC decision and remanded the case “with instructions to retroactively instate and award retroactive back pay for Dr. Trotter in the position she was discriminatorily denied as of the date [D]HHS denied her [an] opportunity for an interview.” The court also: (1) ordered DHHS to apologize for its “disrespect . . . showed to [Dr. Trotter;]” (2) awarded Dr. Trotter “her reasonable lawyers fees and costsf;]” and (3) ordered extra training in the non-discriminatory treatment of applicants for DHHS’s management by the Office of State Personnel. DHHS appeals.
*658II,Issues
DHHS argues the superior court erred when it: (1) applied multiple standards of review when it substituted new findings of fact for those in the SPC final decision; (2) determined the SPC final decision was unsupported by substantial evidence and was arbitrary and capricious; (3) concluded that the SPC erred in its conclusions of law that DHHS had discriminated against Dr. Trotter based on age; and (4) ordered DHHS to issue an apology to Dr. Trotter and to provide extra training for DHHS management.
III.Standard of Review
“[When] we . . . review[] a ‘review proceeding’ in the superior court and petitioners are appealing pursuant to N.C. Gen. Stat. § 7A-27, we . . . apply N.C. Gen. Stat. § 150B-52 . . . .” Lincoln v. N.C. Dep’t of Health & Human Servs., 172 N.C. App. 567, 569, 616 S.E.2d 622, 624 (2005). N.C. Gen. Stat. § 150B-52 (2005) states:
A party to a review proceeding in a superior court may appeal to the appellate division from the final judgment of the superior court as provided in G.S. 7A-27. The scope of review to be applied by the appellate court under this section is the same as it is for other civil cases.
“[T]he appellate court examines the trial court’s order for error of law. The process has been described as a twofold task: (1) determining whether the trial court exercised the appropriate scope of review and, if appropriate, (2) deciding whether the court did so properly.” Carillon Assisted Living, LLC v. N.C. Dep’t of Health & Human Servs., 175 N.C. App. 265, 270, 623 S.E.2d 629, 633 (internal quotation omitted), disc. rev. denied, 360 N.C. 531, 633 S.E.2d 675 (2006).
IV.Superior Court’s Standard of Review
DHHS argues the superior court erred when it applied both a de novo review and the whole-record test when it substituted new findings of fact for those found in the SPC decision.
“The proper standard of review by the trial court depends upon the particular issues presented by the appeal.” Bobbitt v. N.C. State Univ., 179 N.C. App. 743, 748, 635 S.E.2d 463, 467 (2006). Our Supreme Court has held that “the substantive nature of each assignment of error dictates the standard of review” during appellate review of an administrative agency’s final decision. N.C. Dept. of Env’t & *659Natural Res. v. Carroll, 358 N.C. 649, 658, 599 S.E.2d 888, 894 (2004) (internal citations omitted).
N.C. Gen. Stat. § 150B-51(b) (2007) states:
[I]n reviewing a final decision, the [superior] court may affirm the decision of the agency or remand the case to the agency or to the administrative law judge for further proceedings. It may also reverse or modify the agency’s decision, or adopt the administrative law judge’s decision if the substantial rights of the petitioners may have been prejudiced because the agency’s findings, inferences, conclusions, or decisions are:
(1) In violation of constitutional provisions;
(2) In excess of the statutory authority or jurisdiction of the agency;
(3) Made upon unlawful procedure;
(4) Affected by other error of law;
(5) Unsupported by substantial evidence admissible under G.S. 150B-29(a), 150B-30, or 150B-31 in view of the entire record as submitted; or
(6) Arbitrary, capricious, or an abuse of discretion.
“Subparts (1) through (4) of N.C. Gen. Stat. § 150B-51(b) are characterized as ‘law-based’ inquiries. Reviewing courts consider such questions of law under a de novo standard.” Gordon v. N. C. Dep’t of Corr., 173 N.C. App. 22, 31, 618 S.E.2d 280, 287 (2005) (internal citations omitted). Subparts (5) and (6) “are ‘fact-based’ inquiries.” Id. at 34, 618 S.E.2d at 289. “Fact-intensive issues ‘such as sufficiency of the evidence to support an agency’s decision are reviewed under the whole-record test.’ ” Id.
On appeal to the superior court, Dr. Trotter assigned error to the SPC final decision: “(1) The SPC made an error of law in its statement of the issue; (2) The SPC’s finding of no age discrimination was ‘unsupported by substantial evidence in view of the entire record[;]’ and (3) The SPC’s finding of no age discrimination was arbitrary and capricious.”
Dr. Trotter’s first allegation is addressed by § 150B-51(b)(4) and is characterized as a “law-based” inquiry requiring de novo review by the superior court. Id. at 31, 618 S.E.2d at 287. Dr. Trotter’s second *660and third allegations are subject to N.C. Gen. Stat. § 150B-51.(b)(5) and (6) respectively, and require review under the whole-record test as “fact-based” inquiries. Id. at 34, 618 S.E.2d at 289. Both de novo review and the whole-record test were appropriate for the issues presented on appeal to the superior court. The superior court appropriately used a de novo review and the whole-record test in its review to the respective assignments of error alleged in the SPC final decision. This assignment of error is overruled.
V. De Novo Review
DHHS argues that the superior court erred when it concluded that the SPC erred in its conclusions of law. We disagree.
De novo review allows the superior court or this Court to consider the matter anew and to freely substitute its own judgment in place of the agency’s. Mann Media, Inc. v. Randolph Cty. Planning Bd., 356 N.C. 1, 13, 565 S.E.2d 9, 17 (2002) (internal citations omitted). Dr. Trotter’s first exception was a law-based inquiry allowing de novo review. Gordon, 173 N.C. App. at 31, 618 S.E.2d at 287.
This Court has stated:
An employee can establish a prima facie case of age discrimination when the employee shows that (1) the employee is a member of the protected class, or over forty years old; (2) the employee applied or sought to apply for an open position with the employer; (3) the employee was qualified for the position; and (4) the employee was rejected for the position under circumstances giving rise to an inference of unlawful discrimination. An inference of unlawful discrimination arises when an employee is replaced by a substantially younger worker.
N.C. Dep’t of Crime Control & Pub. Safety v. Greene, 172 N.C. App. 530, 538, 616 S.E.2d 594, 600-01 (2005) (internal citation and quotation omitted).
Reviewing the case anew, the superior court applied the Greene elements when it concluded that Dr. Trotter had met her burden of establishing aprima facie case. Id. The superior court stated:
Dr Trotter’s prima facie case here is a strong one. It is uncontroverted she applied for a vacant position. Furthermore the uncontroverted evidence clearly demonstrates that Dr. Trotter, unlike some discrimination claimants, was extremely well qualified for *661the position she sought. It is also beyond question that Dr. Trotter satisfied the third and fourth elements of her prima facie burden, namely that, despite her qualifications, Mr. Prichard rejected her application and then quickly filled the position by hiring a substantially younger, less-qualified applicant.
The superior court acted within its statutory authority to review the issue of the petition to the SPC de novo as a law-based inquiry. N.C. Gen. Stat. § 150B-51(b)(4) (2007); Gordon, 173 N.C. App. at 31, 618 S.E.2d at 287. The superior court properly exercised its appropriate de novo scope of review. Id., Carillon Assisted Living, 175 N.C. App. at 270, 623 S.E.2d at 633. This assignment of error is overruled.
VI. Whole Record Test,
DHHS argues that the superior court erred in its determination that the SPC decision was unsupported by substantial evidence in the record. We agree.
Dr. Trotter’s second and third assignments of error qualified as fact-based inquiries under N.C. Gen. Stat. § 150B-51(b)(5) and (6). The superior court was required to apply the whole-record test. Gordon, 173 N.C. App. at 34, 618 S.E.2d at 289. “A court applying the whole record test may not substitute its judgment for the agency’s as between two conflicting views, even though it could reasonably have reached a different result had it reviewed the matter de novo." Watkins v. N.C. State Bd. of Dental Exam’rs, 358 N.C. 190, 199, 593 S.E.2d 764, 769 (2004) (internal citations omitted) (emphasis supplied). Instead, the superior court “must examine all the record evidence^ — that which detracts from the agency's findings and conclusions as well as that which tends to support them — to determine whether there is substantial evidence to justify the agency’s decision.” Id. (internal citations omitted). “ ‘Substantial evidence’ means relevant evidence a reasonable mind might accept as adequate to support a conclusion.” N.C. Gen. Stat. § 150B-2(8b) (2005).
The superior court reviewed the record of Dr. Trotter’s petition, considered the application and hiring process, the applications of Dr. Trotter and Seay, and Pritchard’s justifications for failing to extend an interview to Dr. Trotter. The superior court determined that no substantial evidence existed to justify the SPC’s final decision which stated “[Pritchard] offered different justifications at different times for his failure to interview Dr. Trotter.” The superior court *662found “[t]he SPC’s finding of no age discrimination . . . ‘unsupported by substantial evidence in view of the entire record’ and ... arbitrary and capricious.”
The whole record test required the superior court to analyze all the evidence in the record in order “to determine whether there [was] substantial evidence to justify the [SPC] decision.” Carroll, 358 N.C. at 660, 599 S.E.2d at 895. If so, the superior court could not substitute its judgment or engage in new fact finding, as it sat as an appellate court. Batch v. Town of Chapel Hill, 326 N.C. 1, 11, 387 S.E.2d 655, 662, cert. denied, 496 U.S. 931, 110 L. Ed. 2d 651 (1990).
The superior court appropriately used the whole-record test in its review of Dr. Trotter’s second and third assignments of error. In determining a lack of substantial evidence to justify the SPC final decision, the superior court improperly found facts and substituted its judgment for the SPC’s decision as between two conflicting views. Watkins, 358 N.C. at 199, 593 S.E.2d at 769. In doing so, the superior court erred and its order is reversed. In light of our holding, it is unnecessary to review DHHS’s remaining assignments of error.
VIL Conclusion
The superior court appropriately used both a de novo review and the whole-record test to the respective issues on appeal when it reviewed the final decision of the SPC. The superior court erred when it improperly substituted its judgment for that of the SPC under the whole-record test. The superior court’s order, which reversed the SPC final decision due to a lack of substantial evidence to support the agency’s order, is reversed. This case is remanded to the superior court with instructions to enter an order to affirm the SPC’s final agency decision.
Reversed and remanded.
Judge STROUD concurs. Judge GEER concurs in the result only by separate opinion.