INDEX MATCH ARRAY with MAX

Dtex20

Board Regular
Joined
Jan 29, 2018
Messages
50
Hi Guys,

I am having a problem understanding how to incorporate a MAX criteria into this formula:

{=INDEX(J:J,MATCH(G13&F13,$G:$G&$F:$F,0))}

In column A:A there are dates, i want the MAX date of which G13 & F13 Match the criteria. So in the example below, car would be G13, Red would be F13... and i want to return J:J but for the 03/01/2019 since that is the MAX.

01/01/2019 Car Red 10,000
02/01/2019 Car Red 10,000
03/01/2019 Car Red 10,001

Also is there a faster way to do the same process that isn't an array on an entire column?

Thanks,
Dtex
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
You can avoid the array formula by using AGGREGATE:

Book1
ABCDEFGHIJ
1ColorVehicle
2RedCar10001
3
10
111/1/2019RedCar10,000
122/1/2019RedCar10,000
133/1/2019RedCar10,001
Sheet2
Cell Formulas
RangeFormula
E2E2=INDEX(J:J,MATCH(AGGREGATE(14,6,A:A/(F:F=$C$2)*(G:G=$D$2),1),A:A,0))
 
Upvote 0
Toadstool that wont work as you are just matching on the date not all criteria.
 
Upvote 0
This should work:

=LOOKUP(2,1/((A:A=MAXIFS(A:A,F:F,F1,G:G,G1))*(F:F=F1)*(G:G=G1)),J:J)

If you dont want to use full column references then change them to something appropriate.
 
Upvote 0
Toadstool that wont work as you are just matching on the date not all criteria.
It works because the "/(F:F=$C$2)*(G:G=$D$2)" forces a #DIV/0! error unless that row also matches the values in C2 and D2.
 
Upvote 0
It works because the "/(F:F=$C$2)*(G:G=$D$2)" forces a #DIV/0! error unless that row also matches the values in C2 and D2.

It doesnt work because the aggregate just produces a date. There obviously could be dates in the column that dont fulfil ALL the criteria. If it encounters them first then the index will produce that. If you dont believe me then just recreate the scenario and put the max date further up column A than the 'hit'. Do not fill in column F or G and place a random word in the same row in column J. Your formula will produce the random word.
 
Upvote 0
For example place this in A10:J13. You formula will produce J10 not J13:

03/01/2019​
01/01/2019​
RedCar
10,000​
02/01/2019​
RedCar
10,000​
03/01/2019​
RedCar
10,001​
 
Upvote 0

Forum statistics

Threads
1,216,746
Messages
6,132,475
Members
449,729
Latest member
davelevnt

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