Thanks for your quick response. However, I got a "#VALUE" error when I input your formula into my sample. I even adjusted the arrays and it still didn't work. Do you have any other suggestions?