Hello Christof, the function meets all expectations for the intended application. Thanks for the quick help. @Bruce I would not have thought that there are so many cases to consider. Thanks for the suggestions. With kind regards Hans