简体   繁体   中英

Index Match with multiple criteria

I have a list of products ranked by percentile. I want to be able to retrieve the first value less than a specific percentile.

Product Orders  Percentile  Current Value  Should Be 
Apples  192     100.00%     29             29
Apples  185     97.62%      29             29
Apples  125     95.24%      29             29
Apples  122     92.86%      29             29
Apples  120     90.48%      29             29
Apples  90      88.10%      29             29
Apples  30      85.71%      29             29
Apples  29      83.33%      29             29
Apples  27      80.95%      29             29
Apples  25      78.57%      29             29
Apples  25      78.57%      29             29
Apples  25      78.57%      29             29
Oranges 2       100.00%     0              1
Oranges 2       100.00%     0              1
Oranges 1       60.00%      0              1
Oranges 1       60.00%      0              1
Lemons  11      100.00%     0              2
Lemons  10      88.89%      0              2
Lemons  2       77.78%      0              2
Lemons  2       77.78%      0              2
Lemons  1       55.56%      0              2 

Currently my formula in the "Current Value" column is: =SUMIFS([Orders],[Product],[@[Product]],[Percentile],INDEX([Percentile],MATCH(FALSE,[Percentile]>$O$1,0))) (entered as an array formula)

$O$1 contains the percentile that I am matching (85.00%).

The current value for "Apples" (29) is correct, but as you can see my formula is not producing the correct value for the remaining products as in "Should Be" but is returning "0". Not sure how to set this up to get it to do what I need it to. I tried several things with SumProduct but couldn't get that to work either. I need someone with more experience to give me a hand on this.

You don't need the SUMIFS(), just the INDEX/MATCH:

=INDEX([Orders],MATCH(1,([Percentile]<$O$1)*([Product]=[@Product]),0))

This is an array formula and must be confirmed with Ctrl-Shift-Enter on exiting edit mode. If done properly then Excel will put {} around the formula.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM