Welcome to the forum.

Won't a simple SUMIF suffice?

=SUMIF(Table2[Paid?],"",Table2[Cost])