简体   繁体   English

Excel MAX/MIN 但仅当相对单元大于 0

[英]Excel MAX/MIN but only if opposing cell is greater than 0

I've found similar examples through searching but I can't find anything that matches the issue that I have...我通过搜索找到了类似的例子,但我找不到任何与我遇到的问题相匹配的东西......

I have a table which shows parts received/rejected, I wish to see the maximum days early/late (I'll only need help with one as the other I can then do.) - but there are dummy orders which I wish to ignore (they show a received/reject of 0).我有一张表格,显示收到/拒绝的零件,我希望看到最早/延迟的最大天数(我只需要一个帮助,因为我可以做另一个。) - 但是有一些我希望忽略的虚拟订单(它们显示接收/拒绝为 0)。

Here is example data from the 'AnnualDump' sheet:以下是“AnnualDump”表中的示例数据:

桌子

My current calculation is我目前的计算是

=IF(ISBLANK(AnnualDump!$H$2),"BLANK",0-MIN(AnnualDump!$G:$G))

[Column H is Received/Rejected and G is VarianceDays] [H 列是 Received/Rejected,G 是 VarianceDays]

This simply looks at if there is any data on the sheet before running the calculation, which is fantastic for 95% of the time... but I want to ignore any values that have a received/rejected of 0...这只是在运行计算之前查看工作表上是否有任何数据,这在 95% 的时间里都很棒......但我想忽略任何接收/拒绝为 0 的值......

I want it to show 29, but it's showing 30 in this instance as it's not ignoring 0qty lines.我希望它显示 29,但在这种情况下它显示 30,因为它没有忽略 0qty 行。 I've tried adding another IF statement but it didn't work:/我尝试添加另一个 IF 语句,但它不起作用:/

Completely stuck now and not sure what the next step to try is... I can do it if I cheat (call both columns to another sheet, turn text white, use an 'IF cell greater than x, then value' to compare the whole lot and then min/max that third column) but I'm trying to avoid that!现在完全卡住了,不确定下一步要尝试什么...如果我作弊,我可以做到(将两列都调用到另一张表,将文本变为白色,使用“如果单元格大于 x,则值”来比较很多,然后是第三列的最小值/最大值),但我试图避免这种情况!

Any pointers or help will be greatly appreciated (complete VBA noob in excel so I'd like to avoid that if possible).任何指针或帮助将不胜感激(在 excel 中完成 VBA noob 所以我想尽可能避免这种情况)。

Thanks谢谢

Try this array formula.试试这个数组公式。 Confirm with Ctrl, Shift and Enter and curly brackets will appear round the formula.使用 Ctrl、Shift 和 Enter 确认,大括号将出现在公式周围。

I would strongly suggest you don't use full column references though as these formulae are rather resource-intensive.我强烈建议您不要使用完整的列引用,因为这些公式相当耗费资源。

=IF(ISBLANK(AnnualDump!$H$2),"BLANK",0-MIN(IF(AnnualDump!$H:$H>0,AnnualDump!$G:$G)))

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

相关问题 仅当公式输出大于零时才使用Excel Max吗? - Excel Max only when Formula output greater than Zero? 如何在 Excel 中查找动态单元格的最大值和最小值 - How to find max and min of a dyanamic cell in Excel Excel公式(如果单元格的后8个字符大于…) - Excel Formula (If last 8 characters of cell are greater than…) 在Excel中对日期范围内的单元格进行计数,但仅限于大于其上方的单元格 - Counting cells in Excel within date range but only when greater than cell above it Excel:仅当最大值大于最小值时,如何突出显示每行的最大值? - Excel: how to highlight the max value of each row only if the maximum value is a certain value larger than the min value? 大于负数且小于正数的最小值的Excel公式 - Excel formula for min value if greater than negative number and less that positive 单元格中的Excel标识日期大于或等于另一个单元格中的日期 - Excel countif date in cell is greater than or equal to date in another cell 在 Excel 中使用小于/大于来最大化单元格值 - Maximise cell value using less than/ greater than in Excel Excel公式检查评估是否大于并返回最大值 - Excel formula checks if evaluation is greater than and returns max value Excel VBA-如果时间大于24小时,则突出显示单元格 - Excel VBA - Highlight cell if time is greater than 24 hours ago
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM