You may use this Array formula in your denominator to pull the value out as the ROW number in which it is found fluctuates in order to have your denominator "follow" the last cell value in Column B:
=INDEX(B$1:B$25,MAX(IF(B$1:B$25>0,ROW(B$1:B$25),"")),1)
This formula can be varied in many ways if I did not understand your intent. Enter with Ctrl, Shift, and Enter.