Sum of numbers in a column after certain cells that would calculate how many "points" between each item - google-sheets

I would like to calculate the amount of points between each "drop" I receive from a boss in a game I play. I am looking to automate this without manually having to =sum() each time I receive a drop.
I'd like column F to show the sum of points between each drop on the row where the drop was received, similarly to column G.
Currently, I have a bunch of =sum()but my spreadsheet is getting pretty long and I'd like to automate it if possible.
Example Sheet

You may try:
=index(if(len(D2:D),scan(,B2:B,lambda(a,c,if(c="",,if(offset(c,-1,2)="drop",c,a+c)))),))

Change your perspective, this will be easier:
=if(C2=False, F1+B2, B2)
Use this for F2 cell (Let F1 to be zero). Then copy this for entire column.

Related

How to create column and lines charts from this simple spreadsheet?

I'm trying to create two charts from a local cycling club's account spreadsheet. These will provide "at-a-glance" overviews of the state of the current finances.
The spreadsheet has a columns with incoming monies (receipts) and the date received, with similar columns for outgoing money (payments).
The first chart will sum up the incoming outgoing columns and display these in a simple column chart. A quick glance should show that the incoming column is taller than the outgoing (hopefully!). This is where I hit my first problem - I don't seem to be able to use SUM in the chart:
I have ended up having to reference a cell containing the sum of the column, but this sum takes into account a cell (C3) which contains balance brought forward from a previous year which I want to ignore for this chart:
The other chart I want is a line chart showing amount of money on the y-axis and time on the x-axis. The receipts line should go up over the year (again, hopefully) and the payments should go down. I'm not even close to getting this correct:
It should be something like this, so as the year passes (x-axis) the amount (y-axis) of receipts and payments increases:
How can I create these charts?
Spreadsheet is here - https://docs.google.com/spreadsheets/d/1-8DzB6c3rZ8evfNJ8iRcO_2BletbH81FV4hIis0-Fj4/edit?usp=sharing
I tried to replicate your graph and found some issues:
On the first graph, you cannot use formula in Data Range. The input should only be a A1 notation. Creating another entry on B16:C17 and use it as graph data is correct.
If you want to ignore C3, just change the formula in your C16 with =SUM(C4:C8)
Based on the sketch you've provided for the second graph, The data will only go up by getting running total or cumulative sum of each data per category (Receipts, Payments). Unfortunately, Google Sheet does not have built it function that can automatically do that. You have to create another column for cumulative sum.
Example:
For Receipts, insert this in D4:
=ArrayFormula(If(len(C4:C8),(SUMIF(ROW(C4:C8),"<="&ROW(C4:C8),C4:C8)),))
It will create another column with cumulative sum of C4:C8.
For Payments, insert this in H3:
=ArrayFormula(If(len(G3:G7),(SUMIF(ROW(G3:G7),"<="&ROW(G3:G7),G3:G7)),))
The dates from Receipts and Payments are different, if you only use the dates of Receipt, the data for Payments will be inaccurate. You need to create another table that will combine the dates and data of those two categories.
Try this:
J2: ={A4:A8;E3:E8}
K2: =ARRAYFORMULA(IFERROR(VLOOKUP(J2:J11, A4:D8, 4, false)))
L2: =ARRAYFORMULA(IFERROR(VLOOKUP(J2:J11, E3:H7, 4, false)))
Make sure to add Labels on K1 and L1.
It should look like this:
Once you have the data, just highlight J1:L11 and Go to Insert -> Chart -> Convert it to Smooth line chart -> Check Aggregate
The graph should look like this:
References:
VLOOKUP
ARRAYFORMULA

Google Sheets vectorized operations

I have a Google sheet with a column of dates and numbers. What I want to be able to do is say: If the date is earlier than 9/1/2021, take the number and multiply by 1, otherwise multiply by 2, then sum all the products. The date and number columns keep getting new information as time goes on.
Now I know that I could create a kind of "scratch-work" column where I have a cell containing =IF(DATEVALUE(A1)<DATEVALUE("2021-9-1"),1,2) * B1 and then apply this formula to the column, and then sum the column somewhere else. However, this is not ideal because every time a new date and number come in I have to reapply the formula to the new scratch-work column's cell.
What I was hoping for was some kind of vectorized operator that would eliminate the need for the scratch work column in the first place. Something like being able to multiply whole columns like =B1:B * 2 or what is more appropriate for my current task, =IF(DATEVALUE(A1:A)<DATEVALUE("2021-9-1"),1,2) * B1:B.
I know you can do this kind of thing in R but haven't seen any vectorized operations in Google Sheets. I'm guessing it's not possible but wanted to ask just in case.
=arrayformula(if(A1:A="","",IF(DATEVALUE(A1:A)<DATEVALUE("2021-9-1"),1,2) * B1:B))

Is there a way to copy certain parts of a formula down a column in Google Sheets?

I'm creating a Google Sheet documenting how many times a certain item appears in a video game with the formula in the D column (formatted to a percent):
=IFERROR(C2/SUM(C2:C51))
I want the "C2" cell to apply down the column (C3, then C4, you get the idea), but I want the "C2:C51" array to stay constant while the C2 part gets applied down the down the column. How could I modify the formula to do this? (I could manually edit the formulas all the way down, I only have 50 rows, but I think it would be helpful to learn for the future)
Try this:
=iferror(C2 / sum(C$2:C$51))
See absolute and relative references.
Alternatively, try this array formula that fills a whole column in one go:
=arrayformula(iferror(C2:C51 / sum(C2:C51)))

How do I make Google Spreadsheet automatically divide a column into another column?

I'm making a spreadsheet that includes a long list of values, with a column that contains a total of values, and after that an average of the values in the row. I need the averaged column to always be 1/6 of the value in the summed column, but I can't figure out a way to make it automatically calculate it for me for each new row.
So far, I have been doing it all manually (type out all the values, manually add them together for the total, then divide by 6 myself for the average) but I'd really like to automate the math parts. I have not found a single way to properly do this - using "=DIVIDE(K2,6)" as a modified version of a suggestion on this other question (modified to use the column I'm actually putting the numbers in) does literally nothing, and I'd have to manually change and paste it into each row, which is actually harder and more tedious than continuing to do the math myself.
Here's an example image of what my columns look like. All the math is correct so far, I just want to automate it so I can type fewer numbers:
EDIT: Combined answers from Scott and Player0 is what worked! thanks for being patient with me! I was able to also use that to make the Sum column function automatically as well, so both columns are fully automated now! :D
You don't have to enter the formula manually on every line. 
Enter =K2/6 in cell L2; then select cell L2
and drag/fill it down to L12. 
(That means click on the dot in the lower right corner of the cell
and drag it down.) 
Or however far your sheet actually goes. 
That will automatically fill in L3 with =K3/6,
L4 with =K4/6, and so on.
use on row 2:
=INDEX(IFERROR(K2:K/6; 0)
also see: ArrayFormula of Average on Infinite Truly Dynamic Range in Google Sheets

How does one import filtered data from “Sheet2” into “Sheet1?

Objective: import filtered data from “Sheet2” into “Sheet1.”
Data is filtered in “Sheet2”, an expense table with dollar amounts in column A, and categories such as “fuel”, “meals”, “parking”, etc. in column B.
I understand that one way to do it is to make a separate sheet for each category and SUM those amounts, and import them into “Sheet1”. I am able to do that, however, I would like to use one sheet and some method to do the following:
In “Sheet2” filter the data for a determined category and display a SUM for that category in a predetermined cell in “Sheet1”.
I have shared the sheets here.
If I am shown how to do this for one category I will be able to copy and paste the function into the appropriate cells in “Sheet1” for the remaining categories.
I am aware that I may not be asking this in the best way. Thanks for all your help.
~ Joe D
=sumif(Sheet2!B:B,"fuel",Sheet2!A:A)
The above formula works for fuel, simply change "fuel" to whatever you are trying to sum.
If you wanted to change what was in Sheet1, cell A1 to fuel instead of fuel total and changed all the other values in column A to match. Removing total (remembering to remove the space too)
You could then use this formula in cell B1, drag it down, and as new expenses were added. It would look at the name of the expense and sum it.
=sumif(Sheet2!B:B,A1,Sheet2!A:A)
If you didn't want to take out the total then the following formula should work if placed in B1 and dragged down.
=sumif(Sheet2!B:B,SUBSTITUTE(A1," total",""),Sheet2!A:A)

Resources