Maxif的阵列公式
我觉得我的问题应该很容易弄清楚,但是我环顾四周,似乎找不到如何获得产生最大值的基本阵列溢出功能。这是我简化的数据集:
Col A | Col B |
---|---|
Apple | 864 |
胡萝卜 | 189 |
梨 | 256 |
Apple | 975 |
梨 | 873 |
胡萝卜 | 495 |
Apple 95 Apple | 95 |
PEAR | 36 |
胡萝卜 | 804 |
我的目标是拥有独特的食物清单(来自col A
) ,从col b
返回最大对应值。 的公式unique
来自col A
的列表很容易... = unique(filter(a:a:a,a:a:a&lt;&gt;'“”)))< /code>,我正在努力的是获得动态
maxifs
与此保持一致。
为了说明,如果我将唯一函数放在单元d2
中(因此,它将溢出到d4
,如下所示,如下所示),则正确的相应的非阵列函数将为<代码> = maxifs(b:b,a:a,d2)(列E
中显示)。我可以将其拖到剩余的行中,但我希望这是动态的,因为将来我的数据集可能会有更多食物。
我会期望工作的是... = filter(maxifs(b:b,a:a,d2:d),d2:d&lt;&gt;“”)
但这返回#value!
。相比之下,如果我要使用sumif/平均值,= filter(sumif(a:a,d2:d,b:b),d2:d&lt;&gt;&gt;“”)
,我得到了什么我希望(这真的使我感到困惑)。
是否有一种方法可以获取动态MaxIF(或在列中产生同等值的任何函数)会根据D列中的唯一值溢出?
I feel like my question should be easy to figure out, but I've looked around and can't seem to find out how to get a basic array spill function that produces the max value. Here's my simplified data set:
Col A | Col B |
---|---|
Apple | 864 |
Carrot | 189 |
Pear | 256 |
Apple | 975 |
Pear | 873 |
Carrot | 495 |
Apple | 95 |
Pear | 36 |
Carrot | 804 |
My objective is to have a unique list of food (from Col A
), that returns the max corresponding Value from Col B
. The formula for unique
list from Col A
is easy... =UNIQUE(filter(A:A,A:A<>""))
, what I'm struggling with is getting a dynamic maxifs
to align with this.
To illustrate, if I put the unique function in cell D2
(thus it would spill to d4
as shown below in blue), a correct corresponding non-array function would be =MAXIFS(B:B,A:A,D2)
(shown in column e
). I could drag this down the remaining rows but I would like this to be dynamic as there may be more food in my data set in the future.
What I would EXPECT to work is... =filter(MAXIFS(B:B,A:A,D2:D),D2:D<>"")
but this returns #Value!
. By comparison, if I were to use sumif/Average, =filter(SUMIF(A:A,D2:D,B:B),D2:D<>"")
, I get what I WOULD expect (which really confuses me).
Is there a way to get a dynamic maxifs (or any function that produces an equal value in column E) that would spill based on unique values in column D?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试:
奖励:
img src =“ https://i.sstatic.net/mfltn.png” alt =“在此处输入图像说明”>
try:
bonus:
bonus 2:
响应以提供更清晰的答案和简化,因为其他人看到的是相同的:
实现此目的的最简单方法是使用阵列公式,例如:
= max(如果($ a $ 1:$ a $ 7 =“苹果”,$ b $ 1:$ b%7))随后ctrl-shift-enter
Responding to provide a more clear answer and simplification as others see this looking for same:
The easiest way to accomplish this is by using an array formula such as:
=MAX(IF($A$1:$A$7="Apple",$B$1:$B%7)) followed by CTRL-SHIFT-ENTER