Could you paste your sumif formula here so I can check it
Two things. First the parameters used in that sumif function are incorrect, and secondly sumif is the wrong function for what you are trying to achieve.
Here is the formula needed for this
Hope this is ok. Let me know if you have any questions