Multiple match with max function

ndblasa

New Member
Joined
Mar 10, 2018
Messages
5
Hello,

I want to match several ranges to return the highest match as follows (this is a tweaked example that I found):

Column AColumn BColumn CColumn D
Order #VersionTypeDate
123454a21/02/2013
123452b28/04/2013
123455a4/8/2013
123453a27/09/2013
123451b2/3/2014
543213a31/03/2014
543214a7/10/2014
543211b13/12/2014
543217b21/12/2014

<colgroup><col><col span="2"><col></colgroup><tbody>
</tbody>

I want to obtain a Date (column D) based on Order# AND Type. Let us assume that Order# = 54321 in cell F2 and Type = a in cell F3.

I have done this, with an error:
=INDEX(D3:D11,MATCH(MAX(IF(AND(A3:A11=F2,C3:C11=F3),B3:B11)),IF(AND(A3:A11=F2,C3:C11=F3),B3:B11),0))

(yes, I am using ctrl+shift for the array formula)

Any help?
Thanks
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
To make things clearer: I want the match to be with the highest version. So in this case it should return 7/10/2014 which is the highest match version for order 54321 and type a.
 
Upvote 0
A
B
C
D
E
F
G
H
1
Order #VersionTypeDate
54321​
12345​
2
12345​
4​
a
2/21/2013​
a
10/7/2014​
9/27/2013​
3
12345​
2​
b
4/28/2013​
b
12/21/2014​
3/2/2014​
4
12345​
5​
a
8/4/2013​
5
12345​
3​
a
9/27/2013​
6
12345​
1​
b
3/2/2014​
7
54321​
3​
a
3/31/2014​
8
54321​
4​
a
10/7/2014​
9
54321​
1​
b
12/13/2014​
10
54321​
7​
b
12/21/2014​

<tbody>
</tbody>

g2=MAX(IF($C$2:$C$10=$F2,IF($A$2:$A$10=G$1,$D$2:$D$10))) control+shift+enter copy across and down
 
Upvote 0

Forum statistics

Threads
1,214,988
Messages
6,122,620
Members
449,092
Latest member
amyap

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