Either your dates in date range or the criteria range is not a proper date value.

what the following gives ?

=isnumber(d2)

and

=isnumber(DEBTS!$A$5)