Index/Match of Max If

Noz2k

Well-known Member
Joined
Mar 15, 2011
Messages
693
Essentially I have some data that is like the below, in a sheet called 'Data':

[TABLE="width: 500"]
<tbody>[TR]
[TD]C1[/TD]
[TD]01/01/2018[/TD]
[TD]TypeA[/TD]
[/TR]
[TR]
[TD]C2[/TD]
[TD]04/01/2018[/TD]
[TD]TypeB[/TD]
[/TR]
[TR]
[TD]C3[/TD]
[TD]23/12/2017[/TD]
[TD]TypeA[/TD]
[/TR]
[TR]
[TD]C2[/TD]
[TD]12/01/2018[/TD]
[TD]TypeC[/TD]
[/TR]
[TR]
[TD]C1[/TD]
[TD]19/12/2017[/TD]
[TD]TypeC[/TD]
[/TR]
</tbody>[/TABLE]


What I want to return in a new sheet for each ID, is the latest date, and the corresponding Type, so the end result would look like below

[TABLE="width: 500"]
<tbody>[TR]
[TD]C1[/TD]
[TD]01/01/2018[/TD]
[TD]TypeA[/TD]
[/TR]
[TR]
[TD]C2[/TD]
[TD]12/01/2018[/TD]
[TD]TypeC[/TD]
[/TR]
[TR]
[TD]C3[/TD]
[TD]23/12/2017[/TD]
[TD]TypeA[/TD]
[/TR]
</tbody>[/TABLE]


I can get the latest date using the below formula, but do not not how to get the value in the corresponding column C for that row

Code:
{=MAX(IF('Data'!A:A=A2,'Data'!B:B))}
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
=INDEX(Data!C:C,MATCH(1,(Sheet1!B1=DataB:B)*(Sheet1!A1=Data!A:A),0),1)
Array formula, use Ctrl-Shift-Enter

where Sheet1 is your results sheet.
 
Upvote 0
Awesome, meets my requirements thank you.

and helped me work out how to do it if I didn't already have the max data in column B.

Thanks,
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,636
Latest member
laura12345

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