|I won't take credit for this, but I will take credit for knowing when to use Google. ;-)|
Stolen without permission from then following site and then modified to match your ranges:
Don't ask me how it works, I haven't spent any time reverse engineering the formula. If you really want to know how it works, use the Evaluate Formula feature to single step through the formula. If you plan to try that, I suggest that you shorten the range to just a few cells to make it easier to follow.
Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.