@jeffrey:
i think MAXIF is only available in Excel 2016 onwards. i hope that doesn't make us less useful here.
@alex:
you can also make use of the PivotTable to give you the Max value of ID, and then vlookup from there.
=VLOOKUP(A2,PT!A:B,2,0)=J2
filter TRUE
otherwise, record a macro.
1. sort data by ID, then by column J in descending order.
2. remove duplicates by ID
this is the raw code recorded (based on a copy of the worksheet Sheet1):
3. you just need to change a little bit of the code to make the rows dynamic according to the last row and based on the activesheet.
add in this to find last row
change ActiveWorkbook.Worksheets("Sheet1 (2)") to activesheet
change 25 (your current last row) to a variable & LR
How to install your new code
- Copy the Excel VBA code
- Select the workbook in which you want to store the Excel VBA code
- Press Alt+F11 to open the Visual Basic Editor
- Choose Insert > Module
- Edit > Paste the macro into the module that appeared
- Close the VBEditor
- Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)
To run the Excel VBA code:- Press Alt-F8 to open the macro list
- Select a macro in the list
- Click the Run button
Bookmarks