I think this should work for you, assuming the 7 in your example is in cell E1:

SUM(INDIRECT("C1:C"&E1))

HTH

Jason