Help with formula - Reward for Help :)

ExcelKiddo29

New Member
Joined
Jun 6, 2015
Messages
1
Hi All,

I have an excel query which has been troubling me all day.

I am building a financial model - as part of this my excel will Identify when certain criteria are met using various IF Functions. This will then produce a "Buy Stock" IF = True, If False "No Trade".

So now my excel file will give me the time I buy the stock. The only problem is, I need a formula to tell the system when to Sell the stock. This is triggered when a further 2 criteria are met e.g. "Sell when D1 > E1". However the only problem is that this sell could happen at any point, whether this be D10 > E10 or D100 > E100.

Essentially I need to look down my data until this certain criteria is met. Following my first IF function whether or not to "Buy Stock".

I believe it may be possible with a type of LookUp and IF. But I need the code written in a way that it will only begin to look up the data from the "Buy Stock" Line on my data.

Any Help ? A reward is available to anyone who can write me the code :)

Regards,

C.L
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hello,

one way

=IF(SUMPRODUCT(--(D1:D100>E1:E100))>0,"Sell","No")

you will need to incorporate your other formula into this formula, something like

=IF(A1="Buy Stock",IF(SUMPRODUCT(--(D1:D100>E1:E100))>0,"Sell","No"),"")

or did you want the Sell to be shown on the actual row?

If so try,

=IF(AND($A$1="Buy Stock",D1>E1),"Sell","no")

ans copy down as far as required.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,146
Messages
6,129,142
Members
449,488
Latest member
qh017

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