简体   繁体   English

具有多个条件和多个结果的Excel索引匹配-返回第一个结果

[英]Excel Index Match with multiple criteria and multiple results - Return first result

I am using index(match(match to find a value based on two different criteria. There are many results that will populate, I just want to return the first result. What do I need to add to my Index Match formula in order to return the first result that matches? Below is my code and a breakdown with images: 我正在使用index(match(match)根据两个不同的条件查找值。将填充许多结果,我只想返回第一个结果。我需要在Index Match公式中添加什么才能返回第一个匹配的结果?下面是我的代码和图像细分:

=INDEX(Master_Query[Current Balance On Hand],MATCH('Waterfall 2018'!$R$1086,Master_Query[Part Number],0),MATCH($BX$1,Master_Query[Date],0))

Cell H1086 is were i need the result to return. 单元格H1086是我需要返回的结果。 I need it to match the highlighted criteria: Part Number in cell R1086 and Date in cell BX1 我需要它来匹配突出显示的条件:单元格R1086中的部件号和单元格BX1中的日期 在此处输入图片说明

This is the table that we get the results from, as you can see there are many results that match the criteria in the formula, i just want to return the first one since they are all the same. 这是我们从中获得结果的表,因为您可以看到有许多与公式中的条件匹配的结果,我只想返回第一个,因为它们都相同。 Note: The date column is filtered; 注意:日期列已过滤; there are multiple dates that will result in different "current balance on hand"(column D) results, thus I cannot use a vlookup formula. 有多个日期将导致不同的“当前余额”(D列)结果,因此我不能使用vlookup公式。 I just filtered it to make it easy to understand my problem. 我只是对其进行过滤以使其易于理解我的问题。 在此处输入图片说明

Attempt 1 尝试1 在此处输入图片说明

Attempt 1(2) 尝试1(2) 在此处输入图片说明

The second Match looks for the column number in the index formula. 第二个匹配项在索引公式中查找列号。 So it doesn't do what you want. 因此,它无法满足您的需求。

One alternative is to add a column to the ELX forecast table that merges the "Date" column and the "Part number" 一种替代方法是在ELX预测表中添加一列,以合并“日期”列和“零件编号”

The formula of that column would be: 该列的公式为:

在此处输入图片说明

After that, in your waterfall sheet, replace your current index/match formula with: 之后,在瀑布表中,将当前索引/匹配公式替换为:

=INDEX(Master_Query[Current Balance On Hand],MATCH(BX$1 & $R1086,Master_Query[Merged column],0))

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

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