ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Logic
  3. Pass/Fail Formula in Excel With IF

Pass/Fail Formula in Excel With IF

By ExcelReady Team·Updated November 1, 2026·7 min read

The short answer

To show Pass or Fail in Excel, use IF with a comparison: =IF(B2>=50,"Pass","Fail"). If the score in B2 is 50 or more, the cell shows Pass; otherwise it shows Fail. Put the pass mark in its own cell, like $F$1, so you can change it once, and use COUNTIF to count how many people passed.

Key takeaways

  • The basic pass/fail formula is =IF(B2>=50,"Pass","Fail"): test, result if TRUE, result if FALSE.
  • Use >= when the pass mark itself counts as a pass. Use > only if it doesn't.
  • Keep the pass mark in one cell and lock it with $ signs, like $F$1, so one change updates every row.
  • Wrap the test in AND when a student must pass every part, and use IFS for three or more results.
  • Count passes with =COUNTIF(C2:C8,"Pass") and divide by the number of results for a pass rate.
On this page+
  1. How to write a pass/fail formula in Excel
  2. Should you use > or >= for the pass mark?
  3. How to keep the pass mark in a cell
  4. How to make a pass/fail formula with two conditions
  5. How to add a third result like Distinction
  6. How to handle blank scores
  7. How to count passes and work out the pass rate
  8. Practise it

A pass fail formula in Excel checks each score against a pass mark and shows a label: =IF(B2>=50,"Pass","Fail"). It is one of the first IF formulas most people write, and it turns up in gradebooks, training records and job tests. This guide shows the basic formula, how to keep the pass mark in a cell, how to handle two subjects or three results, and how to count the passes.

How to write a pass/fail formula in Excel#

The pass/fail formula is an IF with a comparison inside it. IF checks a condition and returns one value when the condition is TRUE and another when it is FALSE:

Excel formula
=IF(logical_test, value_if_true, value_if_false)

All the examples use this table of test scores in A1:B8, with a pass mark of 50:

ABC
1StudentScoreResult
2Aisha72
3Ben45
4Chloe50
5Dev38
6Elena91
7Farid64
8Grace49

Follow these steps:

  1. Click C2.
  2. Type =IF(B2>=50,"Pass","Fail").
  3. Press Enter. Aisha scored 72, so C2 shows Pass.
  4. Select C2:C8 and fill down (Windows: Ctrl+D; Mac: ⌘D). You can also double-click the small square at the bottom-right of C2.

Ben (45), Dev (38) and Grace (49) get Fail. Everyone else gets Pass. The words Pass and Fail need double quotes because they are text. If IF itself is new to you, start with the Excel IF function explained simply.

Should you use > or >= for the pass mark?#

Use >= (greater than or equal to) when a score equal to the pass mark is a pass, which is the usual rule. Chloe scored exactly 50:

FormulaChloe's result
=IF(B4>=50,"Pass","Fail")Pass
=IF(B4>50,"Pass","Fail")Fail

That one character changes the result for anyone sitting right on the line, so check the rule before you write the formula. In Excel, "greater than or equal to" is written >=. The order => is an error.

How to keep the pass mark in a cell#

Put the pass mark in its own cell so you can change it without editing every formula. Type Pass mark in E1 and 50 in F1. Then write this in C2 and fill it down:

Excel formula
=IF(B2>=$F$1,"Pass","Fail")

The $ signs make F1 an absolute reference: it stays pointing at F1 as the formula moves down the rows, while B2 changes to B3, B4 and so on. To add the dollar signs, click on F1 in the formula bar and press F4 on Windows or ⌘T on a Mac.

Now change F1 to 60 and the whole column updates. Farid (64) still passes, but Chloe (50) now fails. This is also how a job test often checks you: it changes an input and expects your results to follow.

How to make a pass/fail formula with two conditions#

Use AND inside IF when a student must pass every part. Say column B is the theory score and column C is the practical score. A student passes only if both are 50 or more:

Excel formula
=IF(AND(B2>=50,C2>=50),"Pass","Fail")

AND returns TRUE only when every test inside it is TRUE. If passing either part is enough, swap AND for OR. To pass on the average instead, test the average:

Excel formula
=IF(AVERAGE(B2:C2)>=50,"Pass","Fail")

These three rules can give different results for the same student, so pick the one your course or employer actually uses. The guide to IF with AND for several conditions has more examples, and IF between two numbers shows how to test a score inside a range, such as 40 to 49 for a resit.

How to add a third result like Distinction#

For three or more results, use IFS or a nested IF and test the highest band first. Here 85 or more is a Distinction, 50 or more is a Pass and anything lower is a Fail:

Excel formula
=IFS(B2>=85,"Distinction",B2>=50,"Pass",TRUE,"Fail")

IFS checks the pairs from left to right and stops at the first TRUE test. The final TRUE,"Fail" pair catches every score that is left. Elena (91) gets Distinction, Aisha (72) gets Pass and Ben (45) gets Fail.

IFS needs Excel 2019, Excel 2021 or Microsoft 365. In older versions, a nested IF does the same job:

Excel formula
=IF(B2>=85,"Distinction",IF(B2>=50,"Pass","Fail"))

Order matters in both. If you test B2>=50 first, Elena's 91 stops there and never reaches Distinction. The guide to nested IF for grades and bands explains why.

How to handle blank scores#

An empty cell counts as 0 in a comparison, so a student who hasn't taken the test yet shows Fail. Check for a blank first and return empty text:

Excel formula
=IF(B2="","",IF(B2>=50,"Pass","Fail"))

"" means empty text. The cell looks blank until a score is typed in. You can also return a word such as "Absent" instead of "". Be careful with text in the score column, too: a score typed as text, like "72 " with a space, can give the wrong result. The article on IF with text covers how IF compares words.

How to count passes and work out the pass rate#

Once column C shows Pass and Fail, COUNTIF counts each label:

QuestionFormulaResult
How many passed?=COUNTIF(C2:C8,"Pass")4
How many failed?=COUNTIF(C2:C8,"Fail")3
Pass rate=COUNTIF(C2:C8,"Pass")/COUNTA(C2:C8)0.571

Format the pass rate cell as a percentage (Windows: Ctrl+Shift+%; Mac: Control+Shift+%) to see 57%. You can also skip the helper column and count scores directly: =COUNTIF(B2:B8,">=50") also returns 4.

Practise it#

The pass/fail formula is short, but the details (quotes, >=, the locked pass mark) are exactly what a timed test checks. Practise the IF function in a live spreadsheet: you type the formula and it checks it instantly. Then move on to nested IF and IFS for three or more results, and keep the IF function guide open as a quick reference. When you feel ready, try the basic Excel test under time pressure.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

The pass mark is 50. Click C2 and write an IF formula that shows Pass if the score in B2 is 50 or more, and Fail if not.

fx
ABCD
1
Student
Score
Result
2
Aisha
72
3
Ben
45
4
Chloe
50
5
Dev
38
6
Elena
91
7
Farid
64
8
Grace
49
9
10
11

Tip: Start with =IF(B2>=50, then the word Pass in double quotes, a comma, and Fail in double quotes.

Practise this in a lesson

LessonThe IF functionMake a cell show one result or another depending on a condition, like Pass/Fail or Over/Under budget.LessonNested IF and IFSHandle more than two outcomes, like letter grades or commission bands, with nested IFs or the cleaner IFS.Function guideIFLearn Excel's IF function with practical examples: flag budgets, label rows and return blanks. Avoid the classic mistakes and practice live.

Frequently asked questions

What is the formula for pass or fail in Excel?

+

Use =IF(B2>=50,"Pass","Fail"), where B2 holds the score and 50 is the pass mark. Change 50 to your own pass mark, then fill the formula down the column.

How do I make a pass/fail formula with two conditions?

+

Put AND inside IF: =IF(AND(B2>=50,C2>=50),"Pass","Fail"). The result is Pass only when both scores reach 50. Use OR instead of AND if passing either one is enough.

How do I show Distinction, Pass and Fail?

+

Use IFS and test the highest band first: =IFS(B2>=85,"Distinction",B2>=50,"Pass",TRUE,"Fail"). In versions before Excel 2019, use a nested IF with the same order.

How do I calculate the pass rate in Excel?

+

Divide the number of passes by the number of results: =COUNTIF(C2:C8,"Pass")/COUNTA(C2:C8). Format the cell as a percentage to see a value such as 71%.

Why does my pass/fail formula show Fail for a blank score?

+

Excel treats an empty cell as 0, and 0 is below the pass mark. Check for blanks first: =IF(B2="","",IF(B2>=50,"Pass","Fail")).

Sources

  • IF function - Microsoft Support
  • IFS function - Microsoft Support
  • COUNTIF function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 1, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. How to write a pass/fail formula in Excel
  2. Should you use > or >= for the pass mark?
  3. How to keep the pass mark in a cell
  4. How to make a pass/fail formula with two conditions
  5. How to add a third result like Distinction
  6. How to handle blank scores
  7. How to count passes and work out the pass rate
  8. Practise it

Keep reading

Logic· 6 min read

The Excel IF Function Explained Simply

The Excel IF function checks a condition and returns one value when it's TRUE and another when it's FALSE. The syntax is =IF(logical_test, value_if_true, value_if_false). For example, =IF(B2>=70,"Pass","Fail") shows Pass for a score of 70 or more and Fail for anything lower. Text results go in double quotes.

Logic· 6 min read

IF With Text in Excel: Check Words and Partial Matches

To check if a cell equals a word, use =IF(A2="Paid","Done","Chase"). To check if a cell contains a word anywhere, use =IF(ISNUMBER(SEARCH("refund",B2)),"Refund","Other"). SEARCH finds the word's position or returns an error, and ISNUMBER turns that into TRUE or FALSE. Wildcards like * don't work with = inside IF.

Logic· 6 min read

Nested IF in Excel: Grades, Bands and Tiers

A nested IF puts a second IF in the value_if_false slot of the first, so one formula can return three or more results. For grades: =IF(B2>=90,"A",IF(B2>=80,"B",IF(B2>=70,"C","F"))). Excel checks the tests in order and stops at the first TRUE one, so test the highest band first.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free