There are a number of ways that you could do this, though it is not very clear how your data is laid out. Which cells do you want the formula in? It might be clearer if you attach a sample workbook - the FAQ describes how to.

Pete