Using OR in an array to calculate percentile

johnny_trauma

New Member
Joined
Sep 12, 2006
Messages
14
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

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Try:

=percentile(if(rangeA=x,if(or(rangeB=y,rangeC=z),rangeD)),0.25)
 
Upvote 0
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?
 
Upvote 0
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?
 
Upvote 0
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?
 
Upvote 0
Try...

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

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,181
Members
448,871
Latest member
hengshankouniuniu

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