-6

Hello right now I have a simple deposit / expense spreadsheet where I have a sum formula that does down column C adding(or subtracting) from what is put into column B. Formula is =SUM($B$1:B1) This works great for the rows that are created however when I add a new row. I have to drag down the forumula in C to cover the new row before it will calculate the new total. I would like this to be done automatically. IE I add a new row and it calculates C from what I entered in B and the history in C. Can't seem to find how to do this. Am using Google Spreadsheets so unsure if this is even possible.

This other question seems to be very complex coding for something else. My question was answered however by user JPV below. Thanks to him for his time.

  • Sorry it is unclear. I don't know how to make it more clear. As for prior research I spent 2 hours trying to find an answer on my own. Both on this site and youtube and in google forums. Just kept getting the same answer: how to make a running total which I already knew. Guess you have to be a profesional to post here since on my first post the people that read it would rather give it a negative then ask for clarification. Will continue my search elsewhere – Jeremy Frank Aug 07 '18 at 09:14
  • How about you post a picture of your sheet, some data and your expectation ? As I see, you want to calculate C by C + B, which will pop out a Circular dependency warning, and I'm very sure this is not good. – HaPhan Aug 07 '18 at 09:45
  • Not sure how to get an SS on here but here is the Link to my google spreadsheet. https://docs.google.com/spreadsheets/d/15KQwdNBmJWYu0W5AcFMSbnWcbyk8qzXVf9h6br31HTA/edit?usp=sharing. This works good but when I try to add another line I have to pull down the C function so that it covers the next line and calculates it. Any way I can code it so that new line which in my case would be line 7 would automatically calculate without me having to drag down? – Jeremy Frank Aug 07 '18 at 09:50
  • It sounds like you mean you want to auto-copy the formula from the cell above, yes? [This question](https://stackoverflow.com/questions/12621842) seems similar. Also, do you realize your formula could also be (cell above)+(cell to left), i.e., (previous running total)+(new transaction)? That’s how I do it in this situation. – Tom Zych Aug 07 '18 at 10:00
  • JPV answered and it now works amazing. Unsure if I have to mark this as solved or anything. Thanks all for the help – Jeremy Frank Aug 07 '18 at 10:58
  • [Here are the things you can do when you get a good answer.](https://stackoverflow.com/help/someone-answers) – Tom Zych Aug 07 '18 at 11:01
  • I don't agree with this being a duplicate. I also can't see how the downvoting can be justified. OP is asking for a formula, not a script. The "auto-copying" of the above formula is nowhere to be found in the question. – JPV Aug 07 '18 at 15:18

1 Answers1

0

Remove contents of column C and then try in C1 this formula

=ArrayFormula((IF(LEN(B1:B), SUMIF(ROW(B1:B),"<="&ROW(B1:B),B1:B),)))
JPV
  • 26,499
  • 4
  • 33
  • 48
  • JPV Thanks This is perfect. I don't understand the formula cause still learning but this did the trick. Thanks. I have added a vote even though it does not count as much. Thanks – Jeremy Frank Aug 07 '18 at 10:57
  • @JeremyFrank: Glad to hear the issue is solved. Most welcome ! – JPV Aug 07 '18 at 13:44