Besides ensuring that the ranges are of equal sizes, you will also need to ensure that the arguments you provide as criteria are true references to ranges (and not arrays returned by another function, for example).
Feel free to post your formulas, along with a description of what each argument refers to. That will help someone to help you.