Hello,
Try this...Not exactly sure what you are trying to do
but I think this is what you want. Here are the results
I get using your test data and your code with some
changes I made:
AB,2,0,0,0,1,0
AB,1,0,0,0,0,0
Here's the code I used, it may be wrong, but I think it
will get you closer...