从数据块中的多个条件创建动态列表 [英] Create a dynamic list from multiple criteria in data block

查看:109
本文介绍了从数据块中的多个条件创建动态列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从多个条件创建列表?

How do I create a list from multiple criteria ?

Item    Type    Data1   Data2   Data3   Data4
Apple   Fruit   81      15      14      11 
Apple   Fruit   77      73      59      42 
Cashew  Nut     16      6       1       1 
Cashew  Nut     100     51      21      12 
Peach   Fruit   75      54      5       2 
Apple   Fruit   64      12      11      1 
Apple   Fruit   47      31      24      15 
Peach   Fruit   6       6       1       0 
Peach   Fruit   68      58      56      47 

条件=水果& (Data2或Data3或Data4)> 20

Criteria = Fruit & (Data2 or Data3 or Data4)>20

结果(格式化的没有间隙的项目列表)

Result (Formatted List of Items with No Gaps)

Apple
Peach
Apple
Peach


推荐答案

这实际上可以使用数组形式中的INDEX函数

This can actually be worked out using the INDEX function in its array form.

H2中的公式是

=IFERROR(INDEX(A$2:A$99, SMALL(INDEX(ROW($1:$98)+(((B$2:B$99="fruit")+(((D$2:D$99>20)+(E$2:E$99>20)+(F$2:F$99>20))>0))<>2)*1E+99, , ), ROW(1:1))), "")

根据需要填写以获取所有结果,也可能需要几行以供将来考虑。您可能希望将 20 放在单独的单元格中,并引用公式中的单元格,而不是为不同的条件编辑公式本身。

Fill down as necessary to catch all of the results and maybe a few rows more for future consideration. You will probably wish to put Fruit and 20 in separate cells and reference the cells within the formula rather than edit the formula itself for different criteria.

为自己的目的编辑此公式时,请记住 ROW(1:98) code> A2:A99 而不是工作表上的实际行。 ROW(1:1)仅仅是 SMALL 函数的 k 参数的计数器,在您填写公式时,会增加(例如<1> 2,3,4等等)

When editing this formula for your own purposes, remember that ROW(1:98) is the position within A2:A99 and not the actual row on the worksheet. ROW(1:1) is simply a counter for the SMALL function's k parameter and will increase (e.g. 1, 2, 3, 4, etc) as you fill the formula down.

这是一个标准公式。 Ctrl + Shift + 输入既不必要也不需要。

This is a standard formula. Ctrl+Shift+Enter↵ is neither necessary or desired.

这篇关于从数据块中的多个条件创建动态列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆