I guess both requirement are different. I already checked those queries before posting. Anyway thanks for notifying once again. The value in main excel, can lie anywhere for instance in A23,A54 etc… and can be repetitive too… And moreover excel contains morethan 10k rows, and all should be in same order…