Today, we will discuss logical tests and the IF function in Excel.
Let’s start with logical test. We want to check whether our students passed the test, i.e. whether they achieved 70 points (cell D2). We need a formula that checks if the number from cell B5 is greater or equal to the value from in cell D2. We aslo have to lock the value from cell D2 by pressing F4 key (Fig. 1).

After copying the formula down, we have our logical answers (Fig. 2)

Logical answers, however, aren’t human answers. If we want something simpler, like pass/fail, we need to use the IF function in cell D5 (Fig. 3).

After copying it down, we have the answers that we want, instead of logical ones. If the logical test returns False, our IF function returns text Fail. If the logical test returns True, our IF function returns text Pass (Fig. 4)

Sometimes, we want to know how many more points a student needs to pass their exam. In that case, we also use the IF function. This time, however, we are changing the direction of our test. We need to check if the value from cell B5 is lower than the value from cell D2 (70 points). If it is lower, it means that the student failed the exam. Calculating the number of missing points is a simple, mathematical operation. We just have to subtract the value from cell B5 (62 points) from the value in cell D2 (70 points). However, if a student passed the exam, we don’t need to calculate anything, so we’re returning 0 points (Fig. 5).
=IF(B5<$D$2,$D$2‑B5,0)

After copying it down, we can see that one student needs 8 points to pass, and another one needs 35. The students who passed the exam, don’t need any more points, that’s why IF function returned 0 for them (Fig. 6).
