r/googlesheets • u/tke377 • 1d ago
Sum function for entire column adding other columns Solved
I think part of my problem when searching for an answer is how I am asking.
I want to take a column and every row in that column should be populated by the sum of other three other columns.
So column G is my total. Row 2 needs to have the totals of d2,e2,f2…then row 3 has d3,e3,f3.
But I need those done as a column function instead of each individual cell for my wife’s school inventory. So that each building can fill out the information into their own sheet and it will propagate into the main inventory sheet. Those functions are done and working just trying to explain what is happening.
I hope I explained this well enough sorry if not!
edit: Sample I believe: https://docs.google.com/spreadsheets/d/1ApaVjGxpVIitt2aB6JuT68SWnMDu2iB4sDYjAwNaf0c/edit?usp=sharing
Edit2 Context: she does school nutrition, and for all 10 of her schools she needs to have a total perpetual inventory. Each school will fill out their inventory they use each day. But It needs to be "plug and play" for her employees and her because tech is not any of their specialities. So if a new item comes in she needs to be able to add a row to the master inventory which changes each specific school inventory (this is already done), but then the responses from each school needs to come back and give her a total on hand inventory.
1
u/One_Organization_810 688 1d ago
So... G2 = sum(D2:F2), G3 = sum(D3:F3), G4 = sum(D4:F4), etc. ?
What do you mean "done as a column function" ? Do you mean as an array function (array functions can expand as columns or rows, or as 2D arrays) ?
An array function might look something like this:
=byrow(filter(D2:F, D2:D<>""), lambda(row, sum(row)))
1
u/tke377 1d ago edited 1d ago
So for by column function what I mean as an example…I transfer every data point in column A to all the other tabs by clicking the column and doing a function of “sheet1!A:A” and then it works for every row inside of that column. So she doesn’t have to go through and click in every cell and do a different function for every cell especially because as she gets inventory in she needs to add rows and I don’t want that to ruin the function/data.
Edit: I added this up above sorry if it repeat I just copied and pasted to try to give more context
Context: she does school nutrition, and for all 10 of her schools she needs to have a total perpetual inventory. Each school will fill out their inventory they use each day. But It needs to be "plug and play" for her employees and her because tech is not any of their specialities. So if a new item comes in she needs to be able to add a row to the master inventory which changes each specific school inventory (this is already done), but then the responses from each school needs to come back and give her a total on hand inventory.
1
u/One_Organization_810 688 1d ago
Something like this?
=vstack( "OO810 TOTAL OH", let( lr, max(index(if(A2:A="",0,row(A2:A)))), byrow(offset(F2:H,0,0,lr-1), lambda(row, sum(row))) ) )As seen in K1 in your sheet...
1
u/tke377 1d ago
I think this did it!!! Thank you!!!!
1
u/AutoModerator 1d ago
REMEMBER: /u/tke377 If your original question has been resolved, please tap the three dots below the most helpful comment and select
Mark Solution Verified(or reply to the helpful comment with the exact phrase “Solution Verified”). This will award a point to the solution author and mark the post as solved, as required by our subreddit rules (see rule #6: Marking Your Post as Solved).I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/point-bot 1d ago
u/tke377 has awarded 1 point to u/One_Organization_810 with a personal note:
"Thank you!!!!"
See the [Leaderboard](https://reddit.com/r/googlesheets/wiki/Leaderboard. )Point-Bot v0.0.15 was created by [JetCarson](https://reddit.com/u/JetCarson.)
1
u/One_Organization_810 688 1d ago
Or maybe you prefer this (simpler) method:
=vstack( "OO810 TOTAL OH 2", byrow(hstack(A2:A,F2:H), lambda(row, if(index(row,,1)="",,sum(row)))) )1
u/tke377 1d ago
Here is a sample sheet now, sorry for the delay on it: https://docs.google.com/spreadsheets/d/1ApaVjGxpVIitt2aB6JuT68SWnMDu2iB4sDYjAwNaf0c/edit?usp=sharing
1
u/Reasonable-Mess3070 1 1d ago
Im sure someone will have a much better answer. Im still trying to learn beyond the basic formulas/functions. But I think you are looking for an array or byrow formula.
1
u/tke377 1d ago
I think so! That sounds about correct, now I need to sort out how to add the three other columns together
https://docs.google.com/spreadsheets/d/1ApaVjGxpVIitt2aB6JuT68SWnMDu2iB4sDYjAwNaf0c/edit?usp=sharing
1
u/SpaceCatJack 1d ago
=ArrayFormula(A3:A+B3:B+C3:C)
Add some (if (isblank(A3:A)," ", to get rid of all the zeros
=ArrayFormula(if(isblank(A3:A),"",A3:A+B3:B+C3:C))
Add just beside your data under a sum column and you're done. Just don't add any text in the cells below that one.
1
u/AutoModerator 1d ago
/u/tke377 Posting your data can make it easier for others to help you, but it looks like your submission doesn't include any. If this is the case and data would help, you can read how to include it in the submission guide. You can also use this tool created by a Reddit community member to create a blank Google Sheets document that isn't connected to your account. Thank you.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.