View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernard Liengme Bernard Liengme is offline
external usenet poster
 
Posts: 4,393
Default Numerical value of logicals

You need to coerce the Boolean into numeric with an arithmetic operation.
Here are two example; each gives result of 1.

1) =SUMPRODUCT(--{FALSE,TRUE,FALSE}, --{TRUE,TRUE,FALSE})
This uses the unary negation operator (-) twice
2) =SUMPRODUCT({FALSE,TRUE,FALSE}*{TRUE,TRUE,FALSE})
This uses multiplication which is what
=SUMPRODUCT({FALSE,TRUE,FALSE}, {TRUE,TRUE,FALSE}) is expected to do but
does not!
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"hmm" wrote in message
...
As I understand it, when logicals are used in a formula, TRUE=1 and
FALSE=0.
If this is so, then why is Excel evaluating the formula below as 0 instead
of
1?

=SUMPRODUCT({FALSE,TRUE,FALSE},{TRUE,TRUE,FALSE})