Automation can't compensate for broken logic, inconsistent formatting, or a lack of a foundational data model in Excel.
Most Excel lookup functions return the first match, but XLOOKUP can reverse the search direction to return the latest record.