Using OR in an array to calculate percentile

johnny_trauma

New Member
I can't seem to stay off this board today.

I thought I had figured out this problem, but to my dismay I was grossly mistaken.

I have a formula used to calculate the percentile when two conditions are met, and I am now trying to edit it to contain a third condition. The catch is that either the second or third condition must be true, not both.

My current formula looks like this:

=percentile(if(rangeA=x,if(rangeB=y,rangeD)),0.25)

but I need to add ...if(rangeB=y or rangeC=z,rangeD)...

Any suggestions?

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Try:

=percentile(if(rangeA=x,if(or(rangeB=y,rangeC=z),rangeD)),0.25)

I've tried this formula, and the numbers just don't seem to be adding up. It appears that the formula is only taking into account the first condition when coming up with the result.

Everything with rangeA=x is being used in the calculation. Do this make any sense?

Ah-ha. I can't use text in the array, or the OR function will ignore them.

Any thoughts on eliminating this problem, short of transforming the text values (it is a very limited number of values) into some sort of numerical representation?

What are x, y and z? Are they named cells?

If not,

=percentile(if(rangeA="x",if(or(rangeB="y",rangeC="z"),rangeD)),0.25)

Also you don't have any "False" qualifiers...what happens if Range A is not x, y or z?

Try...

=percentile(if(rangeA=x,if((rangeB=y)+(rangeC=z),rangeD)),0.25)

Hope this helps!

That worked like a charm. Thanks for all the help.

Replies
2
Views
996
Replies
3
Views
2K
Replies
0
Views
657
Replies
12
Views
609
Replies
6
Views
640

1,219,672
Messages
6,149,616
Members
450,904
Latest member
Gracifer

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.

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