Buy/Sell calculation formula needed

karibian

New Member
Joined
Jul 9, 2011
Messages
1
Excel Workbook
OpenCloseSignal
13301290BUY
13101270BUY
11701170BUY
12001120BUY
11201160-
11301150-
11401150-
11501160-
11501130-
11401090-
11201050-
1050980BUY
9801000-
1010990-
990950-
940940-
920970-
9901020-
990990-
10001020-
10301070SELL
10901070-
Hello, As you can see, I have quite a problem on formulating the buy/sell calculation from the table below. Sheet1
Excel 2007

I would like to make a calculation formula where if the third column (Signal) assign "BUY", then the numeric value from the first column on the next row after the "BUY" signal (opening price of the next day) would be the subtrahend for the numeric value from the first column on the next row after the "SELL" signal, and the given result would be shown in the next column of Signal column.

If the numeric value after the buy signal is bigger than the value after the sell signal, it would search for another bigger value after another sell signal. And if those requirements do not meet, it would produce "unrealized" text instead.

Is it possible? I'm sorry for the trouble on my first thread post. Just a college kid trying to finish a task. :p
Thank you so much.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Explain how multiple BUYS are supposed to be processed exactly? You have 5 BUYS showing and 1 SELL ... what is the result supposed to look like?
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,351
Members
452,907
Latest member
Roland Deschain

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top