There's a lively conversation about querying data that is not ideally shaped to answer the desired question over on Table Forums. It is related to an earlier time shortly after scripts were made possible in Airtable when I recommended (in 2020) that a script should be afforded the ability to become a custom formula. I'm not the only developer who has thought about this.
@kuovonne provides an approach to answering the question that started the conversation. But I have and still would love custom formulas to do this.
Imagine a different approach that requires only your data and one API call to OpenAI that costs about 1/60th of a penny.
Given this GPT query:

This is a straightforward idea, but when performing queries across data tables that may not be ideally shaped, we will increasingly see LLMs provide answers where scripting or formulaic approaches are complex and require skills and added development time (of course).
gptPrompt("Given this list of dates, determine which is the latest:", [{field1}, {field2}, {fieldn...}])
Sadly, this formula is not possible, but it could be if custom scripts could be the underlying logic of custom formulas. In my view, this is one of the most significant missed opportunities for Airtable in this decade.