IF公式与范围标准

IF公式与范围标准

本文介绍了MAX IF公式与范围标准的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过多个条件设置最大值时遇到问题。问题是一个标准应该命名为range(TYPE),哪些内容会改变。数据是数字和文字。当然,整个公式是数组公式。

  = MAX(IF($ C $ 2 = $ B $ 27:$ B $ 509, IF($ F7 = $ F $ 27:$ F $ 509,IF($ C $ 27:$ C $ 509 = TYPE,H $ 27:H $ 509))

我试图以某种方式实现OR函数,但它不能正常工作TYPE范围的内容是它最多包含3个文本变量,用户应该可以选择3, 2或1个,这些变量的顺序应该是灵活的,任何帮助将不胜感激。谢谢!



编辑



在这种情况下,我想要的结果是14%,我希望公式只能在类型b,c(TYPE命名范围)中搜索最大值,但结果为0%,公式现在如下所示: / p>

  = MAX(IF($ G $ 4 = $ B $ 4:$ B $ 20,IF($ H4 = $ D $ 4:$ D $ 20,IF($ C $ 4:$ C $ 20 = TYPE,E $ 4:E $ 20)))
解决方案

根据您的样本数据,此公式应适用于您:

  =集合体(14,6,($ E $ 4:$ E $ 15 *($ B $ 4:$ B $ 15 = $ G $ 4)*($ C $ 4:$ C $ 15 = $ H $ 4)*(($ D $ 4:$ D $ 15 = $ G $ 8)+($ D $ 4:$ D $ 15 = $ G $ 9)+($ D $ 4:$ D $ 15 = $ G $ 10)),1)

概念证明









注意事项:




  • 如果您的数据源中的类型为空,并且所选的类型也为空,那么数据将被包含在可接受的年份和频道匹配之中。

  • Excel 2010或更高版本。


I'm facing a problem with trying to have max value with multiple criteria. The issue is that one criteria should be named range (TYPE) which contents will change. Data is numbers and text. Of course the whole formula is array formula.

=MAX(IF($C$2=$B$27:$B$509,IF($F7=$F$27:$F$509,IF($C$27:$C$509=TYPE,H$27:H$509)))

I tried to somehow implement OR function but it doesn't work properly. The thing with TYPE range is that it contains up to 3 text variables, user should be able to pick 3,2, or 1 of them and the order of these variables should be flexible. Any help would be greatly appreciated. Thanks!

EDIT

My desired result in this case is 14%. I wish formula to search for max value only among types b, c (TYPE named range) but the result is 0%. The formula now looks like this:

=MAX(IF($G$4=$B$4:$B$20,IF($H4=$D$4:$D$20,IF($C$4:$C$20=TYPE,E$4:E$20))))
解决方案

Based on your sample data, this formula should work for you:

=AGGREGATE(14,6,($E$4:$E$15*($B$4:$B$15=$G$4)*($C$4:$C$15=$H$4)*(($D$4:$D$15=$G$8)+($D$4:$D$15=$G$9)+($D$4:$D$15=$G$10))),1)

Proof of Concept

Functions used:

Caveat:

  • If a type in you data source is blank, and a type picked is also blank, then the data will be included as acceptable provided year and channel match as well.
  • Excel 2010 or later.

这篇关于MAX IF公式与范围标准的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 08:09