sum if dynamic range

Copper Contributor

see attached file.  Col i is either debit or credit.  col j is an amount.  in cell s46 i have this formula

sumif($I$15:I40,credit,Cash_Advance_Amount)

 i have named the range "debit" as q46

Cash_Advance_Amount is another named range.  initially i named range $J$15:$J$21 as Amount.  then i went to the Name Manager and edited this . now the Refers To section has this formula - 

=offset('Cash Advance-Bugando MC'!$J$1,0,0,COUNTA('Cash advance-Bugando MC'$J:$J),1)

 advance

Cash Advance-Bugando MC is the name of the worksheet.

when i try out this formula, it works through cell J21.  after that, the credit about is off by the debit amount.  in other words, up to J21, the debit amount and the credit amount are correct then the debit amount is more than the newly entered credit.

 

thank you for your help

1 Reply

@BethBeth101pls share the sheet.