Yes this all can be done, but as you noted, with all the different combinations that you're wanting to track, this not going to be small. I'm not going to try to code it here at the moment, but should have something for you in 24 to 48 hours.