IF with #VALUE! ERROR

Z

Zsolt Szabó

Hi, everybody

I like to make a stop loss calculator for my stock positions using the
interval low prices.
Characters:
Yesterday High = B17
Yesterday Low = B18
Yesterday Stop Loss = B19
Today High = C17
Today Low = C18
Today Stop Loss = ?
The amount I let the stock play with = A14
Here is the rule:
I have a stop loss price in B19 from yesterday.
If the today low is lower than B19 (stop loss), than the broker sold my
position, end of story. C18<B19 = “OUT†(If possible with red fill color
and white font color)

If today low C18 is higher than yesterday stop loss B19 but lower or equal
than yesterday low B18 : I like to use (hold) yesterday stop loss.
B19<C18<=B18 = B19

If today low C18 is higher than yesterday low B18 than I like to use a new
stop loss (today stop loss) C18-$A$14

My calculation was
C19 =IF(C18<=B18,B19,IF((C18-$A$4)<=B19,B19,C18-$A$4))
C20 =IF(C18<B19,"OUT",IF(C19>B19,C19,B19))

But when B19<C18<=B18 than I have an #VALUE! error
 

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