Excel 2019 Bible

(singke) #1

Chapter 13: Using Formulas for Conditional Analysis


13


In cell D3, the first logical condition returns TRUE because the first three characters of the
item number are 202. The second logical condition returns FALSE because the middle sec-
tion of the item number is PRT, not FIN. According to Table 13.1, a TRUE condition and
a FALSE condition return FALSE, and 0 percent is the result. Cell D5, on the other hand,
returns TRUE because both logical conditions return TRUE.


Referring to logical conditions in cells


The AND function in Figure 13.5 includes two logical conditions that evaluate to TRUE or
FALSE. The arguments to AND can also reference cells as long as those cells evaluate to
TRUE or FALSE. When building a formula with the AND function, it can be useful to break
out the logical conditions into their own cells. In Figure 13.6, the inventory listing is modi-
fied to show two extra columns. These columns can be inspected to understand why a par-
ticular item does or does not get the discount.


FIGURE 13.6


A modified inventory listing


With these modifications, the result doesn’t change, but the formula becomes


=IF(AND(D3,E3),10%,0%)
Free download pdf