Excel 2019 Bible

(singke) #1

Part IV: Managing and Analyzing Data


FIGURE 26.5
Entering a data validation formula


  1. On the Error Alert tab, choose Stop for the Style and then type An odd number
    is required here in the Error Message field.

  2. Click OK to close the Data Validation dialog box.


Notice that the formula entered contains a reference to the upper-left cell in the selected
range. This data validation formula was applied to a range of cells, so you might expect
that each cell would contain the same data validation formula. Because you entered a rela-
tive cell reference as the argument for the ISODD function, Excel adjusts the formula for
the other cells in the B2:B10 range. To demonstrate that the reference is relative, select cell
B5 and examine its formula displayed in the Data Validation dialog box. You’ll see that the
formula for this cell is

=ISODD(B5)

An alternative method is to enter the logical formula into a cell and then enter a cell reference in the Formula field
in the Data Validation dialog box. For this example, cell C2 would contain =ISODD(B2), and that formula would be
copied down the column to cell C10. Then the Formula field in the Data Validation dialog box would have this formula:
=C2. Most of the time, entering the formula into the Formula field is easier and more efficient.
Free download pdf