Similar thread in the Formulas/Functions forum...

https://www.excelforum.com/showthread.php?t=1164682