Hi Patel45 and thanks again for your help.When I tired to run the second formula I get a "Run Time Error 1004"