Adjusted Margin gain

Dear All: Just to make it easier on the test, is there a formula for adjusted margin gain on investment? Meaning you borrow 4000 on margin and use another 1000 to buy 5000 worth of stock total, price starts at $25 and at end of year it’s $45. What is the holding period yield for the margin? Stalla says (Ending Balance-Beg Balance-Interest on Margin)/(Beginning Balance+Amt Borrowed) but Schweser doesn’t have anything that looks like this, and CFAI problems don’t have dividends anywhere in the problem. Help

so your end position is 5000*45=225,000, initial is 25*5000=125,000 and your personal initial investment is 1000*25=25,000, cuz you borrowed the rest so now: (225,000-125,000-interest on margin)/25,000=100/25=400% if you didn’t borrow (225,000-125,000)/125,000=80%