INDEX仅检索标准下的某些行 [英] INDEX to retrieve only certain rows under a criterion

查看:112
本文介绍了INDEX仅检索标准下的某些行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,现在修正了,可以在这里看到: Excel从sumif语句获取当前行。我现在只有一个小问题,当我使用:

  = IF(SUMIF('Master Data'! $ C $ 2:$ C $ 200,'资源视图(2)'!B22,'Master Data'!$ W $ 2:$ W $ 200)> 0,INDEX('Master Data'!$ E $ 2:$ E $ 90, MATCH(B22,'Master Data'!$ C $ 2:$ C $ 90,FALSE)),)

C是表中的人员名称,有时有多个此名称的实例,然后在搜索索引时,只返回找到的第一个结果。当我想要的行时,我有一列在W列中设置为 1 的标志。



有没有办法只匹配SUMIF中指定的列W = 1或> 1的行?



我可以解决问题,如果我排序的原始表由国旗最大的第一,但这是一个黑客。我正在寻找的是这样的:

  = IF(SUMIF('Master Data'!$ C $ 2: $ C $ 200,'资源视图(2)'!B22,'主数据'!$ W $ 2:$ W $ 200)> 0,INDEX('Master Data'!$ E $ 2:$ E $ 90,MATCH(B22 * * WHERE'Master Data!$ W2:$ W $ 200> 0 **,'Master Data'$ C $ 2:$ C $ 90,FALSE)),)
/ pre>

或者如果有一种方法来创建表的第二个实例,那么只显示标记> 0的结果?



我可以复制表并将其放在隐藏的表单中,但是在这种情况下,原始表格中的任何新条目都不会添加到隐藏的表中

解决方案

我认为以下应该做到:

  = IFERROR(INDEX('Master Data'!$ E $ 2:$ E $ 200,MATCH(1,(B22 ='Master Data'!$ C $ 2:$ C $ 200)主数据'!$ W $ 2:$ W $ 200 = 1),FALSE)),)

但是你需要输入它的数组公式。不使用输入,而是 - Ctrl + Shift + 输入


I had a problem, now fixed, that can be seen here: Excel Get current row in from sumif statement. I'm just having one more small problem now in that when I use:

=IF(SUMIF('Master Data'!$C$2:$C$200,'Resource View (2)'!B22,'Master Data'!$W$2:$W$200)>0,INDEX('Master Data'!$E$2:$E$90,MATCH(B22,'Master Data'!$C$2:$C$90,FALSE)),"") 

C is a persons name in a table and sometimes there is multiple instances of this name and then when searching the index only returns the first result found. I have a flag set to 1 in column W when its the row I want.

Is there any way to only match with the rows where column W =1 or >1 as specified in the SUMIF?

I can fix the problem if I sort the original table by the flag largest first but that's a bit of a hack. What I'm looking for would be something like this:

=IF(SUMIF('Master Data'!$C$2:$C$200,'Resource View (2)'!B22,'Master Data'!$W$2:$W$200)>0,INDEX('Master Data'!$E$2:$E$90,MATCH(B22**WHERE'Master Data!$W2:$W$200>0**,'Master Data'!$C$2:$C$90,FALSE)),"")

Or if there is a way to create a second instance of the table I have, that only shows results that have the flag >0?

I can just copy the table and put it in a hidden sheet but in that case any new entries to the original table won't be added to the table in the hidden sheet.

解决方案

I think the following should do it:

=IFERROR(INDEX('Master Data'!$E$2:$E$200,MATCH(1,(B22='Master Data'!$C$2:$C$200)*('Master Data'!$W$2:$W$200=1),FALSE)),"")

But you will need to enter it array formula. Not using Enter, but instead - Ctrl+Shift+Enter.

这篇关于INDEX仅检索标准下的某些行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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