It worked. Thanks again. One more thing. Is there a way to set it so that if there are noe values to calculate, you don't get the #DIV/0! error?