简体   繁体   中英

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(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. I need it to match the highlighted criteria: Part Number in cell R1086 and Date in cell 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. I just filtered it to make it easy to understand my problem. 在此处输入图片说明

Attempt 1 在此处输入图片说明

Attempt 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"

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))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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