
Use the IF function to compare two cells
The following tip is a solution for comparing two cells line by line.
Prepare a new worksheet, filling the first two columns with the
values 0 and 1 as shown in Figure 2-12.
4
To compare cells line by line:
1. Select cells C2:C11 and type the following formula:
=IF(A2&B2="11","OK",IF(A2&B2="10","First Value
is OK",IF(A2&B2="01","Second Value is OK",”Both
Values are FALSE”))).
2. Press <Ctrl+Enter>.
Logical Functions 51
2
Figure 2-12