You might want to investigate the AGGREGATE function: https://support.office.microsoft.com...ain11.chm60533