For example I have 200 rows of data with the key being the first field e.g. 'Department ID'

How do I separate and categorize the excel sheet in a way that it categorizes all the rows which have LIKE Department IDs and when it hits the next NOT LIKE row where Department ID is different, it creates a line or a blank row and starts with the 2nd set of department IDs.