I have problems with conditions

Greenlee

New Member
Joined
Aug 31, 2014
Messages
23
I think its quite complicated so I would need to show you :) but i will try

So this is my table (sheet name: BACKTESTING)
Gyazo - 18e6618f6f26ba50b4937012cb11de5a.png

This is my second sheet (sheet name BACKTESTING RESULTS)

Gyazo - 8a07ad8210ee284c294add4d27a7adb5.png

So what do I want to do:

so this is the formula for now:
=COUNTIFS(BACKTESTING!D3:D7;"=BAT";BACKTESTING!B3:B7;"=EUR/AUD";BACKTESTING!C3:C7;"=M15";BACKTESTING!K3:K7;"=1") from backtesting page but I want to add 2 more conditions from 2nd sheet
1st when you choose TF=timeframe M15 that would show results for M15 not for M5,H1 or H4 and second when I would choose on the right side EUR/AUD it would show EUR/AUD not also EUR/JPY ( dropdown of currencies) ...

If I was not understandable enough please let me know
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Which cells define the conditions? So, which cell is the timeframe in? Which cell is the currency in?

Chris.
 
Upvote 0
I'm still not entirely sure of the timeframe condition, what values will actually be in the cell, and what will happen based on those values?

Here is what I have so far:

Code:
=IF(E3="TF",COUNTIFS(BACKTESTING!D3:D7;"=BAT";BACKTESTING!B3:B7;F2;BACKTESTING!C3:C7;"=M15";BACKTESTING!K3:K7;"=1"),COUNTIFS(BACKTESTING!D3:D7;"=BAT";BACKTESTING!B3:B7;F2;BACKTESTING!C3:C7;"=M5";BACKTESTING!K3:K7;"=1"))
Chris.
 
Upvote 0
I will try to explain one more time :)

So what I would like to do: This is the following condition: COUNTIFS(BACKTESTING!D3:D7;"=BAT";BACKTESTING!B3:B7;"=EUR/AUD";BACKTESTING!C3:C7;"=M15";BACKTESTING!K3:K7;"=1") from BACKTESTING sheet so where says the window TRADES: I would like to have this condition COUNTIFS(BACKTESTING!D3:D7;"=BAT";BACKTESTING!B3:B7;"=EUR/AUD";BACKTESTING!C3:C7;"=M15";BACKTESTING!K3:K7;"=1") but Timeframe should be M15(15minutes)(dropdown) and currency should be EUR/AUD(dropdown) becuase if I would use M5(5minutes) then this condition should give me different results then the timeframe for M15
 
Upvote 0
So this works?

Code:
=COUNTIFS(BACKTESTING!D3:D7;"=BAT";BACKTESTING!B3:B7;F2;BACKTESTING!C3:C7;E3;BACKTESTING!K3:K7;"=1")
Chris.
 
Upvote 0
This code works but this code is from Backtesting sheet so I need 2 more conditions from Backtesting Result sheet ( Gyazo - 218c99689d7f19947b003b7d7f7154e3.png - Backtestin Result sheet ) from this sheet I need to add 2 more condition to pick TimeFrame and Currency:

Example: (this code is for backtesting sheet=COUNTIFS(BACKTESTING!D3:D7;"=BAT";BACKTESTING!B3:B7;F2;BACKTESTING!C3:C7;E3;BACKTESTING!K3:K7;"=1") + now I need to add if I pick TF:M15 and Currency:EUR/AUD) will show me this results if I choose TF5 and Currency EUR/AUD will not show me this results.

Actually I need to add to this code
=COUNTIFS(BACKTESTING!D3:D7;"=BAT";BACKTESTING!B3:B7;F2;BACKTESTING!C3:C7;E3;BACKTESTING!K3:K7;"=1")</pre> those two conditions: show me those results if I pick TF15 and Currency EUR/AUD :)

Thank you very much sorry for being not clear




</pre>
 
Upvote 0
So you'd want to say:

Code:
=IF(OR(E3<>"M15",F2<>"EUR/AUD"),"",COUNTIFS(BACKTESTING!D3:D7;"=BAT";BACKTESTING!B3:B7;F2;BACKTESTING!C3:C7;E3;BACKTESTING!K3:K7;"=1"))
Chris.
 
Upvote 0
Yes yes yes, Thank you very much, but one more thing if I change time frame to M5, I should only extend this code right?
 
Upvote 0
You're welcome.

I don't really understand the question, but if you wanted to swap M15 and M5 you can just switch them round in the code.

Chris.
 
Upvote 0

Forum statistics

Threads
1,214,566
Messages
6,120,257
Members
448,952
Latest member
kjurney

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