Hi Jadgon,
Thought I would create a file for you to look at, it has not been achieved in the most streamline way and there may be many pitfalls with your actual data running through it. Given that you have no other replies to the thread i will share what i had created. Maybe it will give you an idea as to whether to amend the data or table layout to make things easier. I have attached the file, hope it helps.