Link to home
Start Free TrialLog in
Avatar of snailcat
snailcatFlag for United States of America

asked on

Remove rows from worksheet based on chronology

I have a large worksheet with multiple rows per 'id' that need to be filtered so that I only get the row with the most recent visit date per 'id'  

See attached  very abbreviated example.  I would need to get back the rows with most recent visitdate for each 'id' so I would want rows 3 and 7.

Is there an easy way to do this with VBA or Filters?
testexcelsheet.xls
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

I cell D2 enter

=A2=A3

and copy down and then filter by false.
Avatar of snailcat

ASKER

ssagibh,

This is giving me "FALSE" for the last row for each ID but I need to have the most recent date which is the second row for ID 1.

Any way to do this without
continuing--
Any way to do this without sorting by date first?
Sorry, try this array formula

=ROW()=MATCH(MAX(IF((A2=$A$2:$A$7),$B$2:$B$7)),IF((A2=$A$2:$A$7),$B$2:$B$7),0)+1

and then filter true
Tried this but only giving TRUE for row 7

See attached
testexcelsheet2.xlsx
ASKER CERTIFIED SOLUTION
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for getting me in the correct direction