IF Formula Determination

T

TRAVEL489

I have 4 columns / cells:

A1 = current price
B2 = low price
C3 = high price
D4 = Action to Take

I am trying to use the IF function to automatically
determine and print the action to take in D4 depending on
the following:

IF A1 is less than B2, then BUY appeears in D4
IF A1 is between B2 and C3, then HOLD appears in D4
IF A1 is higher than C3, then SELL appears in D4

I am using the following formula in the formula bar
without success, any suggestions?

=IF(A1<B2,"BUY","",(B2<A1<C3,"HOLD","",(A1>C3,"SELL","")))

If I don't include the middle IF determination
{B2<A1<C3,"HOLD","",}, it works just fine. That is, BUY
or SELL appear in D4 depending on the value in A1 and its
relationship to B2 or C3.

The problem comes when trying to also determine if the
current price A1 lies between the low price B2 and the
high price C3. In that case, a #value error message
appears in D4.

Any advice would be greatly appreciated.
 
B

Bob Phillips

Try this modification

=IF(A1<B2,"BUY",IF(AND(B2<=A1, A1<C3),"HOLD",IF(A1>=C3,"SELL","")))

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
G

Guest

-----Original Message-----
Try this modification

=IF(A1<B2,"BUY",IF(AND(B2<=A1, A1<C3),"HOLD",IF (A1>=C3,"SELL","")))

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)




.
 
G

Guest

. Reply (E-mail) Forward (E-mail)

Subject: Look up values
From: "Bill in ABQ"
<[email protected]> Sent: 1/22/2004
10:10:11 AM




Try this:

=IF(A1<B2,"BUY",IF(AND(A1>B2,A1<C3),"HOLD",IF
(A1>C3,"SELL",0)))
..
 
G

Guest

. Reply (E-mail) Forward (E-mail)

Subject: Look up values
From: "Bill in ABQ"
<[email protected]> Sent: 1/22/2004
10:10:11 AM




Try this:

=IF(A1<B2,"BUY",IF(AND(A1>B2,A1<C3),"HOLD",IF
(A1>C3,"SELL",0)))
..
 

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