What do you mean by " end of the range" ?Only a columnar or row range ?
In this case the answer an be found at
Lookup Last Value in Column or Row – Excel - Automate Excel (among others)
Use the INDEX formulas which return cell references when embedded like
Code:
=SUM(A2:INDEX(A:A,COUNT(A:A)))
or variations thereupon
Of course posting an example sheet would make our life easier ( no pics please)