Hi, Thanks Sixthsense, that is exactly what I wanted....I am going through your formula, can I ask you why you repeated "aaa" i.e. C5="aaa","bbb","aaa").......thanks in advance.