Share via

Quartile Function and Arrays Question

Anonymous
2017-10-30T16:07:40+00:00

I need some help with the Quartile function and Arrays. I have 4 values that I need to find the 75th percentile from. The problem is that the Quartile function seems to be searching for cell address or something instead of raw value.

=QUARTILE((

IFERROR(VLOOKUP($A4,Breakdown2!$A$166:$W$189,B$1+1,FALSE),0)

,IFERROR(VLOOKUP($A4,Breakdown2!$A$341:$W$364,B$1+1,FALSE),0)

,IFERROR(VLOOKUP($A4,Breakdown2!$A$516:$W$532,B$1+1,FALSE),0)

,IFERROR(VLOOKUP($A4,Breakdown2!$A$663:$W$686,B$1+1,FALSE),0)

),3)

Due to reasons I need to find the 4 values so I don't necessarily have the exact cell reference . Each

IFERROR(VLOOKUP($A4,Breakdown2!$A$166:$W$189,B$1+1,FALSE),0)

is basically a raw value. So in essence, my function is trying to do this.

=QUARTILE((1,2,3,4)),3)

Overall, how do I turn (1,2,3,4) in to an array that Quartile can use?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2017-10-30T16:57:04+00:00

Lorenz wrote:

my function is trying to do this.

=QUARTILE((1,2,3,4)),3)

Overall, how do I turn (1,2,3,4) in to an array that Quartile can use?


If you had 4 constants, you would write:

=QUARTILE({4,2,1,3},3)

But note that the result is 3.25, not 3.  If you are really interested in finding the second largest or third smallest, you would write:

=SMALL({4,2,1,3},3)

or

=LARGE({4,2,1,3},2)

Note the curly braces around the constant array. But that syntax works only for constants.

You don't have constants. Instead, you have expressions of the form IFERROR(VLOOKUP(....),.0).  In that case, you might write something like the following:

=QUARTILE(CHOOSE({1,2,3,4}, VLOOKUP("a",$C$1:$D$4,2,0), VLOOKUP("b",$C$1:$D$4,2,0),

VLOOKUP("c",$C$1:$D$4,2,0), VLOOKUP("d",$C$1:$D$4,2,0)),3)

That formula can be normally-entered (press Enter as usual) because Excel recognizes {1,2,3,4} as an array.

(In my example, C1:C4 has the letters "a", "b", "c" and "d" in random order, and D1:D4 has the corresponding numbers 1, 2, 3 and 4.)

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Anonymous
    2017-10-30T19:36:55+00:00

    Like Lorenz, I learnt a lot from this. Many thanks for clever use of CHOOSE with array

    Bernard

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2017-10-30T18:38:06+00:00

    Thank you so much.  With your post, I was able to solve my problem AND learn something new.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2017-10-30T17:19:04+00:00

    You formula should result in =QUARTILE({1,2,3,4},3) not =QUARTILE((1,2,3,4),3)

    But I was unable to get Excel to accept this

    =QUARTILE({VLOOKUP($A4,Breakdown2!$A$1:$D$6,B$1+1,FALSE) ,VLOOKUP($A4,Breakdown2!$A$1:$D$6,B$1+1,FALSE) ,VLOOKUP($A4,Breakdown2!$A$1:$D$6,B$1+1,FALSE) ,VLOOKUP($A4,Breakdown2!$A$1:$D$6,B$1+1,FALSE)},3)

    I can get an answer using four cells for the values - see snip

    best wishes

    Was this answer helpful?

    0 comments No comments