Index/Match with two criteria to return past first instance

Mattman121

New Member
Joined
Apr 11, 2016
Messages
20
I am working with a sheet where I am doing an Index/Match where I pull data from a master sheet onto a separate sheet if it meets the two criteria it needs too. I know the Index/Match will only return the first instance but I read online that you can add count function to a column in the sheet and use that to modify the Index/Match formula to obtain however many results there are.

Right now I have it working by using to separates that accompany the master, the first pulls through the first criteria and then the second pulls the second criteria. I thought it would be easier and overall cleaner to be able to just pull to one sheet.

=INDEX('All in One'!$A$2:$I$660,MATCH(1,('All in One'!$D$2:$D$660>0)*('All in One'!$F$2:$F$660=0),0),1)

This is what i have for the two criteria.

Any input is greatly appreciated!

Thanks,

Matt
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hi,

Similar to this one. In your case, assuming the following setup where columns B & C correspond to your D and F and the info you want to return when there's a match seats in column A:
ABCDE
1To return if Match
Val 1
Val 2Results
2A00B
3B40G
4C11J
5D01M
6E01R
7F01
8G10
9H01
10I41
11J40
12K00
13L01
14M30
15N41
16O31
17P41
18Q11
19R10
20S11
21T11

<tbody>
</tbody>

in E2:
Code:
=IF(ROW(1:1)>SUMPRODUCT(--($B$2:$B$21>0),--($C$2:$C$21=0)),"",
INDEX($A$2:$A$21,MATCH(SMALL(IF(($B$2:$B$21>0)*($C$2:$C$21=0),ROW($A$2:$A$21)),ROW(1:1)),ROW($A$2:$A$21),0),1))
validate with Ctrl+Shift+Enter (array formula) and copy down as necessary

Regards
XLearner
 
Upvote 0
Forgot to mention: in the first part of the formula SUMPRODUCT(--($B$2:$B$21>0),--($C$2:$C$21=0)) can be replaced with COUNTIFS($B$2:$B$21,">"&0, $C$2:$C$21,0) if you prefer

Regards
XLearner
 
Last edited:
Upvote 0
That worked perfectly, thank you so much!

On somewhat of a side note, would it be possible to have that search through all the sheets in my workbook. I have been having problems linking all the data to the "master" sheet so going directly through each sheet would probably work better!

Thanks again!

Matt
 
Upvote 0
Hi,
Counting, Suming...accross worksheets is no problem although not straightforward. Returning several matches accross worksheets is also doable (i.e. Vlookup across multiple sheets in excel) when we know what we're looking for (Pen in the article) but that's not your case.

Not sure what you expect is doable but don't take this as a definitive answer as they are people with much more knowledge than mine...

Regards
XLearner
 
Upvote 0

Forum statistics

Threads
1,218,220
Messages
6,141,231
Members
450,344
Latest member
renslaw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top