If you can write an Excel formula, you can build your own function.
Excel might be the world’s most widely used programming language; Microsoft is on a journey to turn it into a better and more powerful programming language, without losing what makes it Excel.