Sum contents in column from starting cell on down without setting an explicit last cell index

For Excel 2003 or before:

=SUM(B5:INDEX(B5:B65536,MATCH(TRUE,INDEX(ISBLANK(B5:B65536),0,0),0)-1,0))

For Excel 2007 or after:

=SUM(B5:INDEX(B5:B1048576,MATCH(TRUE,INDEX(ISBLANK(B5:B1048576),0,0),0)-1,0))

I came up with a hack that works and isn't super ugly...

  1. Insert a blank column before B, which will become the new B
  2. Merge the B and C cells above the row you want to start the SUM
  3. In cell C:1 paste the forumla =SUM(C:C)
  4. Hide column B

I don't know why it works, but it does