简体   繁体   English

在 excel 中找到最大值或最小值,有条件

[英]find max or min in excel, with conditions

In my spreadsheet I have a column with negative and positive values.在我的电子表格中,我有一列包含负值和正值。 I need to get the minimum among all positive values and the maximum among all negative ones.我需要得到所有正值中的最小值和所有负值中的最大值。 How can I do so?我该怎么做?

Use array formulas.使用数组公式。 In the following examples, the values you're checking are in A2:A10 .在以下示例中,您检查的值位于A2:A10中。

Maximum negative:最大负数:

=MAX(IF(A2:A10<0,A2:A10))

Press Ctrl + Shift + Enter when entering the formula.输入公式时按Ctrl + Shift + Enter Formula will then appear bracketed by {...}.然后,公式将出现在 {...} 的括号中。

Minimum positive:最小正数:

=MIN(IF(A2:A10>=0,A2:A10))

Also enter as an array formula by pressing Ctrl + Shift + Enter也可以通过按Ctrl + Shift + Enter作为数组公式输入

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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