Excel IF Formula for Pass, Fail, and Did Not Sit Results
Question details
Create a formula that labels exam results as PASS, FAIL, or DNS based on their percentage or whether the cell is blank.

- 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.
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.
Use a nested IF formula to classify results
Use this formula to check for a blank result first, then apply the 50% threshold.
Click an empty cell in the same row as the first result, such as S2 if the result is in R2.
Type =IF(R2="","DNS",IF(R2>50%,"PASS","FAIL")) and press Enter. Replace R2 with the address of your first result cell if needed.
Select the formula cell and drag its fill handle down the output column to classify the remaining results.

Use IFS to list each result condition
Use IFS if your version of Excel supports it and you prefer to list the conditions separately.
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. Open the worksheet: Open WPS Spreadsheets and use Open to select your workbook.
- 2. Select an output cell: Click an empty cell beside the first result, such as S2 for a result in R2.
- 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. Fill and save: Drag the formula cell's fill handle down the column, then select Save to save the workbook.

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.




