Relational Query in Excel

Relational Query in Excel

Assume the following data:

    A    B   
1   ID  Stat
2   1   1 
3   1   2 
4   2   6 
5   3   4

I want to be able to select the minimum and maximum values from column B for all rows that match a value in column A. However, I cannot seem to get values for just those rows, but rather get the max/min value for all of the column.

I've tried variations of the following:

=MAX(IF(A:A = 1, B:B))

Of course, that returns 6, while I want to return 2.

答案1

As Máté said, if you use CTRL + SHIFT + ENTER rather than just ENTER it should work as it will make it an array formula.

相关内容