find max or min in excel, with conditions

馋奶兔 提交于 2019-12-06 04:39:16

问题


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?


回答1:


Use array formulas. In the following examples, the values you're checking are in A2:A10.

Maximum negative:

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

Press Ctrl+Shift+Enter when entering the formula. 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



来源:https://stackoverflow.com/questions/6666057/find-max-or-min-in-excel-with-conditions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!