The Computer Oracle

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

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Dreaming in Puzzles

--

Chapters
00:00 Sum Contents In Column From Starting Cell On Down Without Setting An Explicit Last Cell Index
00:46 Answer 1 Score 5
01:06 Accepted Answer Score 3
01:22 Answer 3 Score 2
01:30 Answer 4 Score 1
01:49 Answer 5 Score 1
02:10 Thank you

--

Full question
https://superuser.com/questions/276638/s...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#microsoftexcel #worksheetfunction

#avk47



ANSWER 1

Score 5


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




ACCEPTED ANSWER

Score 3


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))



ANSWER 3

Score 2


Try this:

sum(B5:B)

It works in Google spreadsheets.




ANSWER 4

Score 1


How about

= SUM(B:B) - SUM(B1:B4)

Obviously it won't work if the cell you want your total in is in the B1:B4 range, but it is at least easier to read than Lance's perhaps more proper way.




ANSWER 5

Score 1


Easiest way is to put the formula like this

"=sum(B5:2)"

This way, you just tell the formula, that you want to start at cell B5 and SUM all values in second column (column B). I know, I'm late with this answer, but just in case somebody faces this issue :)