VBA may have a bad reputation, but it's still one of the most effective ways to automate repetitive actions in standard XLSX ...
If you can write an Excel formula, you can build your own function.