To return a TRUE or FALSE value in Excel, use a logical comparison operator (such as =, >, <, <>) between two values or cell references. For example, typing =A1>10 into a cell will automatically return TRUE if the value in cell A1 is greater than 10, and FALSE if it is not. This is the most direct way to perform a logical test without needing a complex function.
Logical tests are the foundation of data validation, conditional formatting, and complex decision-making within a spreadsheet. By creating a formula that results in a Boolean value (TRUE or FALSE), you can quickly identify outliers, verify that data meets specific criteria, or create triggers for other formulas to follow. While many users immediately jump to the IF function, it is important to understand that the logical test inside the IF function is actually a standalone formula that returns TRUE or FALSE on its own.
What You'll Need
- A computer with Microsoft Excel installed (any version from 2007 to the current Microsoft 365 version).
- A dataset or a few cells containing numbers, text, or dates to test against.
- Basic knowledge of how to select a cell and enter a formula starting with the equals sign (=).
Step-by-Step
- Identify your target cells: Decide which cell you want to test and what value it should be compared against. For example, if you have a list of sales figures in column B and you want to know if a sale exceeded $500, your target is column B and your comparison value is 500.
- Select the output cell: Click on the empty cell where you want the TRUE or FALSE result to appear. This is usually the cell immediately to the right of your data.
- Start the formula: Type the equals sign (
=). Every formula in Excel must begin with this symbol to tell the program that you are performing a calculation rather than entering plain text. - Enter the first reference: Type the cell address you are testing (e.g.,
B2) or click on the cell with your mouse. - Choose your logical operator: Type the operator that represents the relationship you are testing. The most common operators are:
=(Equal to)>(Greater than)<(Less than)>=(Greater than or equal to)<=(Less than or equal to)<>(Not equal to)
- Enter the comparison value: Type the number, text (inside double quotes), or cell reference you are comparing against. For example,
=B2>500or=B2="Completed". - Press Enter: Once the formula is complete, press the Enter key. Excel will evaluate the expression and display either TRUE or FALSE in the cell.
- Apply to multiple rows: To repeat this test for an entire column, click the small green square (the fill handle) in the bottom-right corner of the output cell and drag it down to the end of your dataset. Excel will automatically adjust the cell references (e.g., B2 becomes B3, B4, etc.) for each row.
Common Mistakes
One of the most frequent errors is forgetting that text strings must be enclosed in double quotation marks. If you type =A1=Pending, Excel will look for a named range called "Pending" rather than the word "Pending." The correct formula is =A1="Pending". Without the quotes, you will likely receive a #NAME? error.
Another common mistake is confusing the "Not Equal To" operator. In some programming languages, this is represented by !=, but in Excel, it is always <>. Using the wrong symbol will result in a formula error or an unexpected result.
Users also often wrap simple logical tests in an IF function unnecessarily. For example, writing =IF(A1>10, TRUE, FALSE) is redundant. The expression =A1>10 already returns TRUE or FALSE by default. While the IF version isn't wrong, it makes the formula longer and slightly slower to process in massive spreadsheets.
Case sensitivity is another point of confusion. By default, the equals operator in Excel is NOT case-sensitive. If you use =A1="YES", it will return TRUE even if the cell contains "yes" or "Yes". If you need a case-sensitive TRUE/FALSE return, you must use the EXACT function, such as =EXACT(A1, "YES").
Tips
To make your TRUE/FALSE results more visually intuitive, use Conditional Formatting. You can set a rule so that any cell containing "TRUE" automatically turns green and any cell containing "FALSE" turns red. This allows you to scan thousands of rows of data and instantly spot the anomalies without reading the text.
If you need to test multiple conditions at once, combine your logical tests using the AND() or OR() functions. For example, =AND(A1>10, B1<20) will only return TRUE if both conditions are met. Conversely, =OR(A1>10, B1<20) will return TRUE if at least one of the conditions is met.
You can also use the NOT() function to reverse the result. If you have a complex logical test that returns TRUE, but you specifically need a TRUE result for the opposite scenario, wrap the whole thing in NOT. For example, =NOT(A1="Closed") will return TRUE as long as the status is anything other than "Closed".
When working with dates, remember that Excel treats dates as numbers. To return TRUE or FALSE based on a date, you can compare a cell to another date cell or use the DATE function. For example, =A1>DATE(2023,1,1) will return TRUE if the date in A1 is after January 1, 2023.
Troubleshooting
If your formula is returning a #VALUE! error, check that you are comparing compatible data types. You cannot use a "greater than" operator to compare a number to a text string. If cell A1 contains the word "Apple" and you enter =A1>10, Excel will return an error because it cannot mathematically compare text to a number.
If the formula is returning FALSE when you are certain it should be TRUE, check for hidden spaces in your data. A cell that looks like it says "Completed" might actually contain "Completed " (with a trailing space). Since "Completed " is not exactly equal to "Completed", Excel returns FALSE. You can fix this by using the TRIM function: =TRIM(A1)="Completed".
If the cell simply displays the formula (e.g., it shows =A1>10) instead of the result, the cell is likely formatted as "Text." To fix this, change the cell format to "General" via the Home tab in the Ribbon, then click into the formula bar and press Enter again to force Excel to re-evaluate the cell.
If you see a #NAME? error, double-check your spelling of functions (like AND or OR) and ensure that any text strings are wrapped in double quotes. This error almost always means Excel doesn't recognize a word you've typed as a valid function or a defined name.
Frequently Asked Questions
Can I change the words TRUE and FALSE to something else?
A basic logical test will only ever return the Boolean values TRUE or FALSE. If you want the cell to say "Yes" or "No" instead, you must wrap the logical test inside an IF function: =IF(A1>10, "Yes", "No").
Does the order of the comparison matter?
Yes. =A1>10 is not the same as =10>A1. The first asks if the cell is larger than 10; the second asks if 10 is larger than the cell. Ensure the subject of your test is on the left side of the operator for clarity.
How do I return TRUE if a cell is empty?
You can use the ISBLANK function. The formula =ISBLANK(A1) will return TRUE if the cell is completely empty and FALSE if it contains any data, including a space or a zero.
Can I use these formulas for data validation?
Yes. In the Data Validation menu, you can choose "Custom" and enter a logical formula. Excel will then use that TRUE/FALSE logic to decide whether to allow a user to enter a specific value into a cell.
Will this work with dates and times?
Yes, because Excel stores dates and times as serial numbers. You can use > or < to determine if one date is before or after another. Just ensure both cells are formatted as dates to avoid confusion.
Is there a way to test if a cell contains a specific word anywhere in the text?
A simple equals sign only works for exact matches. To return TRUE if a cell contains a specific word as part of a longer sentence, use a combination of SEARCH and ISNUMBER: =ISNUMBER(SEARCH("keyword", A1)). This returns TRUE if the keyword is found anywhere in the cell.