View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
joeu2004 joeu2004 is offline
external usenet poster
 
Posts: 2,059
Default IF statement syntax

"Sander" wrote:
Example: IF(C16<1 & C151,-B15).


That should be written:

=if(and(C16<1, C151), -B15, "")

Note that I added "" to cover the case when the condition is not met. You
might replace "" with something else. But if you omit that part, the IF
function will return FALSE, which is usually undesirable.


----- original message -----

"Sander" wrote in message
...
What is the proper syntax for a non-nested, two-condition IF statement?

Example: IF(C16<1 & C151,-B15).

This syntax appears to work when the two elements of the condition are
simultaneously true. Unfortunately, -B15 is apparently always returned,
even
when the two conditions are not simultaneously true. What up? How do I
get
this right?

Thanks.