Multiple Logical Tests Within Array If Function

varchar50

New Member
Joined
Feb 5, 2014
Messages
2
I've found multiple threads answering the question about using multiple logical tests with an if function with Excel 2010, and the consensus approach is:

=IF(AND(Test1,Test2),ValueTrue,ValueFalse)

However, when I try to use this in an array formula I end up with a #VALUE! error.

I am trying to add interactive dashboard functionality to a calculation by having a small table reference a large table and make calculations based on user inputs.

I am using the following formula:

{=QUARTILE(IF(AND($I:$I=$Q4,$A:$A=Sheet1!$B$2),$N:$N,""),1)}

N is the field I want my quartile calculated on
Q4 is a static cell with a specific value I want found in I:I
Sheet1!B2 is a user selected value on a separate tab

The formula works fine before I add the AND operator and the $A:$A=Sheet1!$B$2 logical test. Are AND/OR operators not valid in array formulas?

If this approach won't work, what other option is there?

Thank you for the help.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
AND and OR are typically not used with array formulas because it will evaluate the AND and the OR across all the values of the array, not independently.

Try this:

=QUARTILE(IF($I:$I=$Q4,IF($A:A=Sheet1!B2,$N:$N)),1)

Confirm with CTRL-SHIFT-ENTER rather than just Enter.
 
Upvote 0
AND and OR are typically not used with array formulas because it will evaluate the AND and the OR across all the values of the array, not independently.

Try this:

=QUARTILE(IF($I:$I=$Q4,IF($A:A=Sheet1!B2,$N:$N)),1)

Confirm with CTRL-SHIFT-ENTER rather than just Enter.
So simple. Thank you for straightening me out. I was going down all kinds of crazy paths to try and figure this out. This worked wonderfully.
 
Upvote 0

Forum statistics

Threads
1,215,268
Messages
6,123,966
Members
449,137
Latest member
yeti1016

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