简体   繁体   English

Excel中的多个条件索引/匹配/计数,以返回单元格值

[英]Multiple Criteria Index/Match/Countif in Excel to return a cell value

I'm looking to pull certain cell values based on several criteria. 我希望根据几个条件提取某些单元格值。 The best way to describe what I'm looking to do is with this sample image: 描述我要做什么的最好方法是使用以下示例图像:

在此处输入图片说明

This is going to be a massive data set with many more unique options in row 6 and in column B, but this is an example. 这将是一个庞大的数据集,在第6行和B列中具有更多唯一选项,但这只是一个示例。

Basically, I need to use the two input cells (B2 and B3, which are dropdowns) to find where a "Y" is populated, and return the value in column A that corresponds to that intersection. 基本上,我需要使用两个输入单元格(B2和B3,它们是下拉列表)来查找“ Y”的填充位置,并返回与该交点相对应的A列中的值。 So, the goal is populating cell E2 with the value where the two drop-downs intersect, AND there is a Y at that intersection (because there are instances where they intersect but there is no "Y"). 因此,目标是在单元格E2中填充两个下拉列表相交的值,并且在该相交处有一个Y(因为在某些情况下它们相交但没有“ Y”)。

I've tried various combinations of Index/Match functions with countifs, but I've been getting errors with everything I try. 我已经尝试过将index / Match函数与countifs进行各种组合,但是我尝试的所有方法都出现了错误。

I have a basic Index/Match that will find the intersection, which isn't tough, but it's incorporating the countif to find where that intersection also has a "Y" that I'm struggling with (and to ignore all intersections that don't have a "Y"). 我有一个基本的索引/匹配项,可以找到相交点,这并不难,但是它结合了countif来找到该相交点还存在我要努力解决的“ Y”(并忽略所有不存在的相交点) t为“ Y”)。

My starting point: 我的出发点:

=INDEX($A$6:$E$37,MATCH($B$2,$A$6:$E$6,FALSE),MATCH($B$3,$B$6:$B$37,FALSE)) = INDEX($ A $ 6:$ E $ 37,MATCH($ B $ 2,$ A $ 6:$ E $ 6,FALSE),MATCH($ B $ 3,$ B $ 6:$ B $ 37,FALSE))

Any tips are greatly appreciated 任何提示,不胜感激

As the result is a number you can try: 结果是一个数字,您可以尝试:

=SUMIFS(A:A,B:B,B3,INDEX(C:E,0,MATCH(B2,C6:E6,0)),"Y")

Or if the combinations are not unique and it adds two or more line together, or if column a is strings and not numbers then use this to return the first: 或者,如果组合不是唯一的,并且将两行或更多行加在一起,或者如果列a是字符串而不是数字,则使用此方法返回第一个:

=INDEX(A:A,AGGREGATE(15,ROW(A7:A37)/((B7:B37 = B3)*(INDEX(C7:E37,0,MATCH(B2,C6:E6,0))="Y")),1))

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM