具有多个条件的索引匹配
Index Match with multiple criteria
我有一个按百分比排名的产品列表。我希望能够检索小于特定百分位数的第一个值。
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
目前我在"Current Value"列中的公式是:=SUMIFS([Orders],[Product],[@[Product]],[Percentile],INDEX([Percentile],MATCH(FALSE,[Percentile]>$O,0)))
(作为数组公式输入)
$O$1 包含我匹配的百分位数 (85.00%)。
"Apples" (29) 的当前值是正确的,但如您所见,我的公式并未像 "Should Be" 中那样为剩余产品生成正确的值,而是返回“0” .不确定如何设置它以使其执行我需要的操作。我用 SumProduct 尝试了几件事,但也无法让它工作。我需要有更多经验的人来帮助我解决这个问题。
您不需要 SUMIFS(),只需要 INDEX/MATCH:
=INDEX([Orders],MATCH(1,([Percentile]<$O)*([Product]=[@Product]),0))
这是一个数组公式,必须在退出编辑模式时使用 Ctrl-Shift-Enter 确认。如果操作正确,那么 Excel 将在公式周围加上 {}
。
我有一个按百分比排名的产品列表。我希望能够检索小于特定百分位数的第一个值。
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
目前我在"Current Value"列中的公式是:=SUMIFS([Orders],[Product],[@[Product]],[Percentile],INDEX([Percentile],MATCH(FALSE,[Percentile]>$O,0)))
(作为数组公式输入)
$O$1 包含我匹配的百分位数 (85.00%)。
"Apples" (29) 的当前值是正确的,但如您所见,我的公式并未像 "Should Be" 中那样为剩余产品生成正确的值,而是返回“0” .不确定如何设置它以使其执行我需要的操作。我用 SumProduct 尝试了几件事,但也无法让它工作。我需要有更多经验的人来帮助我解决这个问题。
您不需要 SUMIFS(),只需要 INDEX/MATCH:
=INDEX([Orders],MATCH(1,([Percentile]<$O)*([Product]=[@Product]),0))
这是一个数组公式,必须在退出编辑模式时使用 Ctrl-Shift-Enter 确认。如果操作正确,那么 Excel 将在公式周围加上 {}
。