why doesn't my conditional formula work?

J

jake

can anyone tell me why the following doesn't work?

=IF(B3="Buy", [G3*(F3-E3)], [G3*(E3-F3)])

or possibly suggest another way of achieving the same result, so that a
'Buy' transaction will produce one calculation, and a 'Sell' (or non-'Buy)
transaction will produce another?

cheers
 
T

tjtjjtjt

You want G3 mulitplied by the result of F3-E3 for true?
and
You want G3 mulitplied by the result of E3-F3 for false?

If so, you should not be using square brackets--replace them with parentheses.
Also, you shouldn't have any spaces in the formula.
=IF(B3="Buy",(G3*(F3-E3)),(G3*(E3-F3)))

tj
 
B

Bob Phillips

=IF(B3="Buy", G3*(F3-E3), G3*(E3-F3))

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
J

jake

cheers all, typically enough i figured this out myself immediately after
posting. when excel help illustrates the use of the IF function it uses
square brackets for some reason...

thanks anyway :)


Bob Phillips said:
=IF(B3="Buy", G3*(F3-E3), G3*(E3-F3))

--

HTH

RP
(remove nothere from the email address if mailing direct)


jake said:
can anyone tell me why the following doesn't work?

=IF(B3="Buy", [G3*(F3-E3)], [G3*(E3-F3)])

or possibly suggest another way of achieving the same result, so that a
'Buy' transaction will produce one calculation, and a 'Sell' (or non-'Buy)
transaction will produce another?

cheers
 
Top