AGGREGATE was built to handle messy data from the start.
An Excel trick that opens nearly infinite possibilities.