Right here. The formula evaluates from left to right.
Basically a condition is tested and if it is true,
perform a calculation or return a value. So:
=IF(test_condition,return_if_true,return_if_false)
is the basic construct. Our first test is to see if A1
contains any data (LEN returns the # of characters). So
if A1 contains more than 0 characters, it must mean there
is something in there. So it is TRUE. Because it is true,
the formula will return 2. But if it is not true, then
move on (return_if_false).
Instead of returning an actual value like 2 if the
statement is FALSE, we embed another if statement to test
B1. Same logic applies here. If B1 equals a zero text
string (nothing in the cell), then return 0.
If both statements fail, we must still return something
to the cell. In this case it is the string "Error."
You can embed up to 7 IF statments. Here's the correct
syntax for 1, 2, and 3 IF statements.
=IF(---,---,---)
=IF(---,---,IF(---,---,---))
=IF(---,---,IF(---,---,IF(---,---,---)))
There are also some other tricks, but this is basically
how it's done.
Jason