combining IF, AND, and OR Functions

  • Thread starter Hillary: needing some help
  • Start date
H

Hillary: needing some help

=IF(G9>0,
AND(F9>=E9,"HOLD",
IF(F9<E9,
OR(F9<E9*1.035,"SELL"))))

not sure how to make this work

=IF(G9>0,AND(F9>=E9,"HOLD",IF(F9<E9,OR(F9<E9*1.035,"SELL"))))
as one line it doesn't work how can I order it to where it will work


thanks
 
J

John C

Not sure what you are trying to accomplish, parts of your formula don't make
sense. Tell us what you want, but not in formulaic terms:
i.e.:
First check if G9<0, if yes, do something, if no, do something else, etc.
 
D

Don Guillett

Perhaps you should look at the help index for AND & OR to see the proper
syntax

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
"Hillary: needing some help"
 
M

Mike H

Hi,

Try this

=IF(AND(G9>0,F9>E9),"Hold",IF(OR(F9<E9,F9<E9*1.035),"Sell",""))

Mike
 
D

David Biddulph

I would recommend that you look at Excel help to remind yourself of the
syntax for Excel functions such as IF, AND, and OR.
At present you are feeding text strings into the AND and OR functions, which
are looking for Booleans (TRUE or FALSE) as inputs.
I wonder whether what you intended may have been
=IF(AND(G9>0,F9>=E9),"HOLD",IF(OR(F9<E9,F9<E9*1.035),"SELL","whatever your
alternative outcome is")) ?

If you are indeed intending to use OR(F9<E9,F9<E9*1.035) as part of the
test, then I assume that this is because E9 might not necessarily be
positive, because if E9 is positive the F9<E9 test is redundant as it would
always be satified if F9<E9*1.035
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top