# Multiple if statements -- my conditions are being ignored

#### PortoMarco

##### New Member
Hi

I have an IF statement that is either not behaving properly or my syntax is wrong.

=LARGE(IF(Return!\$C\$2:\$C\$600=\$X\$3,Return!\$P\$2:\$P\$600,IF(Return!\$D\$2:\$D\$600=\$X\$6,Return!\$P\$2:\$P\$600)),AA6)

The conditions are:

X3 -- the strategy
X6 -- in or out
AA6 - AA15 - the ranking 1-10

The Return tab:

C = Strategy
D = in/out
P = Data I am calling

So, call the largest value if the strategy in C is the same as the value in X3 & is listed as "in" in X6.

Whenever I input this formula, it doesn't bother filtering the data at all. It just provides me with the top 10 for the whole data set; ignoring both conditions in X3 and X6.

Thanks

### Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
... or my syntax is wrong.
I think that is the case.

Try this instead. Remember to confirm with Ctrl+Shift+Enter

=LARGE(IF(Return!\$C\$2:\$C\$600=\$X\$3,IF(Return!\$D\$2:\$D\$600=\$X\$6,Return!\$P\$2:\$P\$600)),AA6)

If you are using Excel 2010 or later, you could also try this, which doesn't require the CSE entry

=AGGREGATE(14,6,Return!\$P\$2:\$P\$600/((Return!\$C\$2:\$C\$600=\$X\$3)*(Return!\$D\$2:\$D\$600=\$X\$6)),AA6)

Last edited:
Thanks. I used the LARGE function, looks like me syntax was wrong.

Replies
6
Views
318
Replies
1
Views
434
Replies
3
Views
99
Replies
0
Views
428
Replies
1
Views
344

1,203,349
Messages
6,054,892
Members
444,760
Latest member
TeckTeck

### 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.

### Which adblocker are you using?

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

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