# 2 Ways To Solve A Pass Or Fail Problem In Excel

### Excel 2013

One question that I’ve gotten a few different times is how to easily determine if a student has failed or passed. Obviously, if you have 2 or 3, it’s very easy to determine. But when you are dealing with a few hundred or thousands, it can become a lot more complex. Here is one question that I got:

“Can any one suggest a formula for below results. i want display if all cell marked as pass then Pass should display in the Final Result, if any one result is Fail then Final result should display Fail

Pass

Pass

Pass

Fail

Pass

Pass

Final result = Pass or Fail

Please help”

One interesting thing about Excel is that there are usually many different ways to get one result. So let me first start by adding this to a spreadsheet. I’ll try to get a valid from answer using 3 different functions.

**If And Sum Function**

One way would be to translate each pass or fail into a 0 or a 1. For example, I could add a column next to it where I could see if the student passed or failed that subject. It would look something like this:

Then, I would use the sum to determine if the student passed all subjects as follows:

=IF(SUM(C2:C7)=6,”Pass”,”Fail”)

2-Using “Countif”

This method will be much easier to do and does not require adding an extra column. How so? Here is the formula I’ll use:

=COUNTIF(B2:B7,”Fail”)

Then, I’ll use an if condition to verify the number of fails:

=IF(COUNTIF(B2:B7,”Fail”)>0,”Fail”,”Pass”)

Frankly, this seems like a much better way to manage the problem.