kumara_faith
Well-known Member
- Joined
- Aug 19, 2006
- Messages
- 922
- Office Version
- 365
Hi,
I have the following table:
I am trying to build a formula in column N and column O as follows:
1) If column M is down by 2% or more, then we will buy 1 unit of the product for the price in column L
2) If column M is up by 2% or more, then we will sell 1 unit of the product for the price in column L
3) We can only buy and sell once. Which means if we have bought previously, we will not buy again even when the price is down by 2% or more until we have sold. The same applies for sell as well
The correct result is as per the table above. I tried using the following IF formula but it does not seems to work.
Appreciate all the help.
I have the following table:
Stock Market Buy Sell Model.xlsx | |||||||
---|---|---|---|---|---|---|---|
K | L | M | N | O | |||
2 | Date | Price | % Difference | Buy | Sell | ||
3 | 1/1/2021 | 100 | -3% | 100 | |||
4 | 2/1/2021 | 105 | 5% | 105 | |||
5 | 3/1/2021 | 95 | -10% | 95 | |||
6 | 4/1/2021 | 115 | 21% | 115 | |||
7 | 5/1/2021 | 85 | -26% | 85 | |||
8 | 6/1/2021 | 120 | 41% | 120 | |||
9 | 7/1/2021 | 119 | -1% | ||||
10 | 8/1/2021 | 118 | -1% | ||||
11 | 9/1/2021 | 117 | -1% | ||||
12 | 10/1/2021 | 115 | -2% | 115 | |||
13 | 11/1/2021 | 85 | -26% | ||||
14 | 12/1/2021 | 120 | 41% | 120 | |||
15 | 13/1/2021 | 105 | -13% | 105 | |||
16 | 14/1/2021 | 95 | -10% | ||||
17 | 15/1/2021 | 115 | 21% | 115 | |||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
M4:M17 | M4 | =(L4/L3)-1 |
I am trying to build a formula in column N and column O as follows:
1) If column M is down by 2% or more, then we will buy 1 unit of the product for the price in column L
2) If column M is up by 2% or more, then we will sell 1 unit of the product for the price in column L
3) We can only buy and sell once. Which means if we have bought previously, we will not buy again even when the price is down by 2% or more until we have sold. The same applies for sell as well
The correct result is as per the table above. I tried using the following IF formula but it does not seems to work.
Excel Formula:
=IF(M3<=-2%,L3,"")
Appreciate all the help.