There is. I gave you an array formula in response to your duplicate post in
the worksheet functions group.
Please don't post the same questions to multiple groups. If I had known you
were satisfied with a solution that requires additional cells, I wouldn't
have wasted a half-hour or more developing and testing the array formula