Welcome to ExcelFox community.

Yes, it would be nice if you could upload a sample file which represents your actual data set. Posting an expected output for a couple of scenarios will also help.