[英]Return Max Value of range that is determined by an Index & Match lookup
I need a cell to display the max value of a range who's row is defined by an index and match formula. 我需要一个单元格来显示一个范围的最大值,该范围的行由索引和匹配公式定义。 I know this will be an array function but I'm struggling to get the syntax right. 我知道这将是一个数组函数,但我正在努力使语法正确。 Here is what my data looks like. 这是我的数据的样子。 I have it laid out with Column Letters and Row Numbers like Excel. 我把它列在列字母和行号上,就像Excel一样。
Using the Table Below as reference, in a second table. 使用下表作为参考,在第二个表中。 When I enter b
in cell A1
and y
in column B1
, the formula in cell C1
should return the value 35
because 35
is the maximum value in columns C:F
on the row determined by A1
and B1
using INDEX
and MATCH
当我在单元格A1
输入b
而在列B1
输入y
时,单元格C1
的公式应返回值35
因为35
是使用INDEX
和MATCH
由A1
和B1
确定的行中的列C:F
的最大值
Table 1. 表格1。
A B C D E F
1 a x 25 6 23 11
2 a y 39 15 42 19
3 b x 28 34 51 24
4 b y 27 19 15 35
5 b z 38 26 12 18
6 c x 12 19 22 15
Now... What I want to do, is to create a formula that finds the max of columns C
through F
in the row that matches the values in A
and B
that are given in a separate table. 现在......我想要做的是创建一个公式,该公式可以找到与单独表中给出的A
和B
中的值匹配的行中C
到F
列的最大值。 For this example we will write the formula in cell C1
. 对于此示例,我们将在单元格C1
编写公式。 The formula should take the maximum of C
through F
based on a match of column A = b
and column B = y
(which the formula tells us is row 4
). 根据A = b
列和B = y
列B = y
(公式告诉我们的是第4
行)的匹配,公式应取C
到F
的最大值。 The value I want in this case would be 35
because it is the max of the 4 columns ( C:F
) on row 4
. 在这种情况下,我想该值是35
,因为它是4列(最大C:F
)上排4
。
This is what my second table should look like with the formula being in row C
这是我的第二个表应该看起来像公式在行C
Table 2. 表2。
A B C
1 b y 35
2 a x 25
3 b z 38
4 c x 22
I tried this: (the formula is in table 2 so it is not explicitly declared in the match portion of the formula. You'll also have to be familiar with tables in excel to get it) 我试过这个:(公式在表2中,所以它没有在公式的匹配部分中显式声明。你还必须熟悉excel中的表才能得到它)
=INDEX(MAX(Table1[C]:Table1[F]),MATCH([@A]&[@B],Table1[A]&Table1[B],0))
I then wrap it with Control + Shift + Enter to Array it. 然后我用Control + Shift + Enter将它包装到Array它。
The problem seems to come when I put the MAX
function inside the array portion of the INDEX
. 当我将MAX
函数放在INDEX
的数组部分内时,问题似乎就来了。 Are there any ways around this? 这有什么办法吗? perhaps I should be using a completely different set of functions? 也许我应该使用一组完全不同的功能?
You don't need an index match formula. 您不需要索引匹配公式。 You can use this array formula. 您可以使用此数组公式。 You have to press CTL + SHIFT + ENTER after you enter the formula. 输入公式后,必须按CTL + SHIFT + ENTER 。
=MAX(IF((A1:A6=A10)*(B1:B6=B10),C1:F6))
SNAPSHOT 快照
当您查找最大值时,可以轻松地将匹配类型更改为1,或者在查找最小值时,可以将-1更改为-1。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.