Methods for Quartile Calculation with Multiple Criteria

Sangar_338

New Member
Joined
Oct 21, 2019
Messages
6
Office Version
  1. 365
Platform
  1. Windows
I need to calculate quartiles on the assumption that 5 criteria are met but I am unable to determine which method is logically the most sound.

From what I can think of, there are various ways to do this: Using the IF function or using an IFS function.

(1) One way seems to be to nest IF functions, and there seem to be two ways to do this.

There seem two ways to do this.

(1.1) Example, calculating Quartile 1 with two criteria:

=QUARTILE(IF(($A$2:$A$100=E2),IF(($B$2:$B$100=F2),$C$2:$C$100),""),1)

Note: It works with 2 criteria.

(1.2) Example, calculating Quartile 1 with 5 criteria:

=QUARTILE(IF(AND($A$2:$A$100=E2,$B$2:$B$100=F2,$C$2:$C$100=G2,$D$2:$D$100=H2,$E$2:$E$100=I2),$C$2:$C$100),1)

Note: I can't get this one to work. Might the logic be flawed?

(2) The other way seems to be to use an IFS function, although I am as of yet unsure about what the logic/formula would look like.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
Thank you, I have made the update to my profile to show that I'm using Microsoft® Excel® for Microsoft 365 MSO. Appreciate the tip.
 
Upvote 0
Thanks for that. (y)
How about
Excel Formula:
=QUARTILE(FILTER($C$2:$C$100,($A$2:$A$100=E2)*($B$2:$B$100=F2)*($C$2:$C$100=G2)*($D$2:$D$100=H2)*($E$2:$E$100=I2)),1)
Although I don't understand why you are limiting col C to the value in G2, when that is the column your using for the quartile
 
Upvote 1
Solution
Thanks for that. (y)
How about
Excel Formula:
=QUARTILE(FILTER($C$2:$C$100,($A$2:$A$100=E2)*($B$2:$B$100=F2)*($C$2:$C$100=G2)*($D$2:$D$100=H2)*($E$2:$E$100=I2)),1)
Although I don't understand why you are limiting col C to the value in G2, when that is the column your using for the quartile
Thank you. I had to go and read up on the FILTER function, as I had not used it before. Your proposed solution is elegant and easy to understand. Much appreciated.

Also, your comment regarding Column C made me realise that I indeed made an error: Column C is not a column that contains criteria data.

Therefore, I have corrected this in the following formula, after making changes in source sheet, so that the entry in row 1 of each of the criteria data columns are actual criteria that require referencing:

=QUARTILE(FILTER($C$2:$C$100,($A$2:$A$100=A1)*($B$2:$B$100=B1)*($F$2:$F$100=F1)*($D$2:$D$100=D1)*($E$2:$E$100=E1)),1)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,102
Messages
6,123,099
Members
449,096
Latest member
provoking

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