Formula Errors

Excel IF Formula for Pass, Fail, and Did Not Sit Results

Elise WilliamsElise Williams Dec 2, 2026 868 views

Question details

Create a formula that labels exam results as PASS, FAIL, or DNS based on their percentage or whether the cell is blank.

Excel IF Formula for Pass, Fail, and Did Not Sit Results
Product
Microsoft Excel
Device & OS
not provided
Scenario
Classify a column of exam results using a 50% pass threshold and identify students who did not sit the exam.
Observed behavior
Results above 50% should return PASS, results at or below 50% should return FAIL, and blank cells should return DNS.
Before you start

Identify the first result cell and an empty column for the classification. Enter results as numeric percentages, such as 50%, rather than the whole number 50.

Solution 1Recommended

Use a nested IF formula to classify results

Use this formula to check for a blank result first, then apply the 50% threshold.

1
Select the output cell

Click an empty cell in the same row as the first result, such as S2 if the result is in R2.

2
Enter the formula

Type =IF(R2="","DNS",IF(R2>50%,"PASS","FAIL")) and press Enter. Replace R2 with the address of your first result cell if needed.

3
Fill down

Select the formula cell and drag its fill handle down the output column to classify the remaining results.

Use a nested IF formula to classify results
The threshold is exclusive: A result of exactly 50% returns FAIL. The DNS check also applies when a formula in the result cell returns an empty string.
Classify results in WPS Spreadsheets

Create the same pass, fail, and DNS formula in WPS

Use WPS Spreadsheets to enter the nested IF formula, classify percentage results, and fill it down your worksheet.

  1. 1. Open the worksheet: Open WPS Spreadsheets and use Open to select your workbook.
  2. 2. Select an output cell: Click an empty cell beside the first result, such as S2 for a result in R2.
  3. 3. Enter the formula: Type =IF(R2="","DNS",IF(R2>50%,"PASS","FAIL")) and press Enter. Adjust R2 if your result is in a different cell.
  4. 4. Fill and save: Drag the formula cell's fill handle down the column, then select Save to save the workbook.
Classify blank results as DNS and apply the 50% thresholdCompatible with Microsoft Excel XLSX and XLS filesFill formulas down a column for multiple students
microsoft office alternative - wps office

Frequently Asked Questions

Does a score of exactly 50% pass?

No. The formula uses R2>50%, so exactly 50% returns FAIL. To include 50% as a pass, change the comparison to R2>=50%.

Why does a blank result return DNS?

The first test, R2="", checks for an empty cell or an empty string and returns DNS before the formula compares the result with 50%.

What if my scores are entered as whole numbers out of 100?

Use 50 instead of 50% as the threshold: =IF(R2="","DNS",IF(R2>50,"PASS","FAIL")). A numeric value of 50 is not the same as 50% in Excel.

How do I apply the formula to every student?

Enter the formula next to the first result, select that formula cell, and drag its fill handle down. Excel adjusts the relative cell reference for each row.