Hi Meghal
Glad it worked out.
And, of course there are way easier ways of doing this, please see enclosed file to a more simple solution.
But yeah, there is probably a way to code something more elegant and generic, that can filter results without sorting the results.
Have a nice day.
BR,
Mustafa