Glad you got it -- it's a little compliated because of the logic you wanted

There is a little bit that can be added to possibly simplify it a little more if you want