Wrestling with fractions and dates. Knowledge of photography is helpful.
On Wed, 18 Nov 2009 10:41:52 -0800, "David Farber"
wrote:
I'm still curious to know the theory behind the (-E40) of the ISERROR code:
=IF(ISERROR(-E40),
2*LOG(16/F40)/LOG(2)+LOG($C$2*(Eval(E40)))/LOG(2),
2*LOG(16/F40)/LOG(2)+LOG($C$2/E40)/LOG(2))
I was thinking that putting a quote mark in a division problem i.e.: 100/2"
would trigger the error and force it to convert the string to a number. Is
your shortcut saying that you can't take the opposite of 2" (for example)
because it's not a number, thus triggering the error condition?
Your original error test was:
ISERROR(2*LOG(16/F40)/LOG(2)+LOG($C$2/E40)/LOG(2))
to decide which branch of the IF statement to take. But this error condition
really only depends on E40 being text or a number. So that is really the only
cell you need to check.
Performing an arithmetic operation on a value will produce an error if the
value is not numeric. So that's what I did by "negating" the value.
One could consider using ISTEXT or ISNUMBER, but if the value is TEXT, but
Excel could interpret the value as a number, this might give undesired results,
in your particular situation where the value will either be or not be followed
by a quote.
It is certainly true that your initial error statement will return a useful
result, but I prefer shorter statements when appropriate.
--ron
|