InvestorsHub Logo

lostcowboy

12/16/11 11:28 PM

#174 RE: PraveenP #172

I don't know how to do that in Excel.

=IF(Q5<0;B5;IF(Q5>0;B5;N4))

Hi PraveenP, this is a bit of code from my Hi/Low demo spreadsheet. Column N is my last buy/sell price. Row 4 is just setting everything up, the action starts in row 5. column B is where you input the stock price. Column Q is where I determine if I have bought or sold any shares. If that number is zero, the number in (N5) is pulled down from (N4). IF I had a buy or a sell in (Q5), then the number in (N5 is gotten from (B5) the stock price that was inputed.

Hope this helps
Clifford

daisy42

09/07/12 9:17 AM

#197 RE: PraveenP #172

Is it necessary to consider stock prices at all? Can't you just use the value of current value of the stock account and its deviation from the starting value, of say $2,000? I.e. if at the end of year 1 the value of the account has dropped to $1,800, i.e. by 10% you buy (approximately) $200 worth more shares, and if at the end of the following year the value has risen to $2,200 you sell $200 worth of shares.

Daisy.