Proving 0 is false and 1 is true with AND(), in Excel

Proving 0 is false and 1 is true with AND(), in Excel

Proving 0 is false and 1 is true with AND(), in Excel.

Proving 0 is false and 1 is true with AND(), in Excel.

This quick lesson shows you how to prove 0 is false and 1 is true, in Excel.

Overview

So, to prove 0 is false and 1 is true, we will use the AND() function. In Excel, AND() is a logical function. In essence, a logical function returns either true or false. Therefore, let’s test it out.

Steps to prove 0 is false and 1 is true with AND(), in Excel

Follow the steps below in proving 0 is false and 1 is true with AND(), in Excel.

Step 1: Testing 0 for false

To test 0 for false, we will use the AND(0) function.

Proving 0 is false and 1 is true with AND(), in Excel
Partial Excel worksheet, showing the function AND(0).
  1. Start a new sheet, and in a blank cell, enter the following formula:
    =AND(0)
    Press Enter.
As a result, AND(0) returns false.

When we use the AND() function to test 0, it returns false.

Step 2: Testing 0 for true

To test 1 for true, we will use the AND(1) function.

Proving 0 is false - AND(1).
  1. In a blank cell, enter the following formula:
    =AND(1)
    Press Enter.
As a result, the function AND(1) returns true.
As a result, the function AND(1) returns true.

So, when we test AND(1), it returns true.

Summary of the results

As you see, when you test 0 for false, the result is false. And, when you test 1 for true, the result is true. Therefore, our proof holds true for both conditions.

Because the inside of a computer works on 0’s and 1’s, we think it was a good way to show you the logic. On the outside of the computer, we see true or false. Essentially, as you see, it is the same thing. Now, you can use it in practice.

Understanding AND()

In high school, you may have heard your teacher ask, what is 4 and 5. What they were saying is, what is 4 multiplied by 5. Or, what is 4 times 5, which is 20. In computing, we write it as 4 * 5.

So, think of AND() as if you are multiplying numbers or results. Anything result that is not equal to 0 is true.

Let’s look at some examples, using 0’s and 1’s:

  • 0 * 0 = 0
  • 1 * 0 = 0
  • 0 * 1 = 0
  • 1 * 1 = 1

Remember, in computing, 0 is false and 1 is true. Thus, let’s test the same proof using true and false.

  • false * false = false
  • true * false = false
  • false * true = false
  • true * true = true

Likewise, the above results can be tested in Excel. Again, using the AND() function, you can do something like =AND(0, 1) or =AND(false, true). Hence, they both return false.

Going forward in your computing, it is suggested to use the literals true and false, instead of 0 and 1.

Some practical examples

Here are some real world examples. Basically, we are checking if a username and password is valid.

Example 1
Example 1 - Proving 0 is false.
As a result, =AND(A2=”jen”) will return false.
Example 2
Example 2.
Entering =AND(B2=”excellover”) will return true.
Example 3
Example 3 - Proving 0 is false.
The =AND(A2=”Jen”, B2=”excellover”) will return a false result. Also, you can use more than one argument in the AND() function.
Example 4
Example 4.
Finally, =AND(A2=”Jenny”, B2=”excellover”) returns a true result.

Related


Excel lessons  Education home  Techronology home