There is no straightforward formula that I can think of to do this. (While I'm there, there is no complex formula that I can think of to do this either.)
It may be possible with a user defined function, but that would involve VBA too.