Index match - multiple criteria

dunmore83

Well-known Member
Joined
Aug 24, 2011
Messages
540
Hi,

I have the following formula;

=IFERROR(INDEX('Clinical-Treatments'!$P$12:$P$312,MATCH($D30,'Clinical-Treatments'!$M$12:$M$312,MATCH($L30,'Clinical-Treatments'!$D$12:$D$312,0))),"")

P12:P312 are text values
M12:M312 are numbers
D12:D312 are dates

The formula is returning a match for the 1st date found so it is not matching both the date & the number.

Any ideas on a solution ??
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
If your version of Excel has the AGGREGATE function then you could use this

=INDEX($P$12:$P$312, AGGREGATE(15, 6, (ROW($P$12:$P$312)-ROW($P$12)+1)/(($M$12:$M$312=$D$30)*($D$12:$D$312=$L$30)), 1))

If not then the following, which must be confirmed with ctrl+shift+enter (not just enter)

=INDEX($P$12:$P$312, SMALL(IF(($M$12:$M$312=$D$30)*($D$12:$D$312=$L$30), ROW($P$12:$P$312)), 1)-ROW($P$11))

HTH
 
Upvote 0
Thanks.

My version of excel does have the AGGREGATE function however I cannot get either of the formulas to work - both are returning a #NUM ! error ??
 
Upvote 0
In that case the value in cell D30 doesn't exist in column M and/or cell L30 doesn't in column D...

What do you get for these two

=MATCH(D30, M12:M312, 0)
=MATCH(L30, D12:D312, 0)
 
Upvote 0
Maybe something like this. Not sure how your sheets are laid out.
This is an array formula that must be entered with CTRL-SHIFT-ENTER.
Drag this formula down and across as needed.


Sheet1


DEKLMNO
29Trial#

DateText Values

30100

11/1/2017
Trial1
31101

11/2/2017Trial2Trial3Trial8
32101

11/15/2017Trial6

33108

11/15/2017Trial7Trial9

<colgroup><col style="width:30px; "><col style="width:68px;"><col style="width:64px;"><col style="width:64px;"><col style="width:95px;"><col style="width:76px;"><col style="width:64px;"><col style="width:64px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
M30{=IFERROR(INDEX('Clinical-Treatments'!$P$12:$P$312,SMALL(IF($D30='Clinical-Treatments'!$M$12:$M$312,IF($L30='Clinical-Treatments'!$D$12:$D$312,ROW('Clinical-Treatments'!$P$12:$P$312)-ROW('Clinical-Treatments'!$P$12)+1)),COLUMNS(#REF!))),"")}

<tbody>
</tbody>
Formula Array:
Produce enclosing
{ } by entering
formula with CTRL+SHIFT+ENTER!

<tbody>
</tbody>


Clinical-Treatments


DELMNOP
11Date

Numbers

Text Value
1211/1/2017

100

Trial1
1311/2/2017

101

Trial2
1411/2/2017

101

Trial3
1511/5/2017

103

Trial4
1611/2/2017

104

Trial5
1711/15/2017

101

Trial6
1811/15/2017

108

Trial7
1911/2/2017

101

Trial8
2011/15/2017

108

Trial9
2111/5/2017

109

Trial10

<colgroup><col style="width:30px; "><col style="width:89px;"><col style="width:64px;"><col style="width:64px;"><col style="width:82px;"><col style="width:64px;"><col style="width:64px;"><col style="width:82px;"></colgroup><tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,909
Messages
6,122,189
Members
449,072
Latest member
DW Draft

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