Thank you for your response

but i dont want to use VBA code please tell me is there any formula to do this exercise, sorry for taxing your time.

Thank you