Thanks, thats works a treat , a problem i seem ot have tho is that it keeps crashing excel when i use it on my large database, excel freezes altogether, no problems on a smaller sample of selections but every time crashes on the file i want to use it on as soon as i copy the formula down it says calculating cells and then freezes and nothing works, so i presume its the ammount of data im trying to rank , but thats another problem i guess.

thanks for your time and help