hi guys, I hope the thread title is appropriate, it took me almost 5 minutes to compose!!!

I'm actually having difficulty with the sumproduct function, I'm trying to count items based on multiple criteria (and yes I have looked under that). I'm using a very helpful formula that I grabbed from this site.

=SUMPRODUCT(1*(base!$B$1:$B$19465=locations!B$1),1*(base!$A$1:$A$19465=locations!$A6))

The problem that I have is that this doesn't work if I replace $B$1:$B$19465 with $B:$B

now as the number of rows on the base sheet may change, this means I need to change the formula each time I change the data on the base sheet which is somewhat ridiculous.

I've been playing around with indirect trying to reference the last cell in a range, but I don't seem to be getting anywhere with that.

Any suggestions?