Hi,
If I understand your question. It sounds like you're going to need two different IF statements, one in each catagory, but they can be nearly identical to each other.
For Catagory A
=IF(condition=True,1,0)
For Catagory B
=If(condition=true,0,1)
I would guess that you're trying to count the number in each catagory. If so, you can use either COUNT or COUNTIF statement.
Hope this helps,
Mike