Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
IF statement syntax
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. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
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. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
IF statement syntax
If true -B15 if false blank
=IF(AND(C16<1,C151),-B15,"") If this post helps click Yes --------------- Jacob Skaria "Sander" wrote: 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. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
IF statement syntax
=IF(AND(C16<1,C151),-B15,"whatever answer you want if your condition isn't
met") -- David Biddulph "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. |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
IF statement syntax
Try it like this:
=IF(AND(C16<1,C151),-B15,"") If C16 is an empty cell it will evaluate to be less than 1. If you don't what that to happen: =IF(AND(C16<"",C16<1,C151),-B15,"") -- Biff Microsoft Excel MVP "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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA syntax | Excel Discussion (Misc queries) | |||
if statement syntax help | Excel Worksheet Functions | |||
need help with syntax of if statement | Excel Worksheet Functions | |||
when writing an IF statement what is the syntax for "Not Equal to. | Excel Discussion (Misc queries) | |||
when writing an IF statement what is the syntax for "Not Equal to. | Excel Discussion (Misc queries) |