Boolean logic in Excel: TRUE/FALSE instead of IF functions

Most of us use the IF function all the time, for example to test if one value is larger than another value. But many times there is an easier way to do it! Let’s use Boolean logic instead – it will save you a lot of time and struggle. Boolean logic, or Boolean algebra, is a kind of algebra where you’re looking for a TRUE or FALSE result.

Let’s look at an example. In this sales report, the sales reps get a bonus if they reach $ 15,000 in sales:

EasyExcel_33_1_Boolean logic in Excel

The most common way to solve this is an IF statement such as IF(C5>$C$2,”TRUE”,”FALSE”)=, but we’ll solve this in the realm of Boolean logic, which makes it a lot easier:

=C5>C2

This formula will return TRUE or FALSE. Of course, in order to copy the formula down, we need to lock the reference to the bonus hurdle in C2 with dollar signs (Shortcut: F4):

=C5>$C$2

Getting used to this logic is also the secret to mastering conditional formatting. Conditional formatting relies on the TRUE/FALSE logic: if the statement is true, the cell will be formatted.

Let’s try to conditionally format the trues and falses in this table. Select all the cells in the bonus column, click on Conditional Formatting from the Home ribbon and choose New Rule. Choose “Use a formula to determine which cells to format” and type the same formula as we used above into the formula field.

EasyExcel_33_2_Boolean logic in Excel

Click on the Format button and choose a fill colour or font colour.

That’s all, and here is the result:

EasyExcel_33_3_Boolean logic in Excel

Bonus tip: If you want to replace TRUE and FALSE with ones and zeroes, it’s done in a second:

Put the logical statement in brackets and add a zero: =(C5>$C$2)+0

This could be a good idea if you want to use the results from column D for further calculations:

EasyExcel_33_4_Boolean logic in Excel

Other easy tricks:

Are you using a non-English version of Excel? Click here for translations of the 100 most common functions.

2 thoughts on “Boolean logic in Excel: TRUE/FALSE instead of IF functions

  1. For the Conditional Formatting formula, wouldn’t =D5 be better, given that the cell formulae in D5:D15 already return True or False to indicate where a bonus is payable?

  2. Pingback: Missing Pieces

Leave a Reply

Your email address will not be published. Required fields are marked *


× 2 = four