The subtraction from the number of each below of row on column AF. Get minus each others gradually row by row pointing upwards by formula in G.sheets - google-sheets

=byrow(AF3:AF;lambda(each;if(each="";"";SUMIFS(INDIRECT("AF"&row(each)&":AF");Indirect("O"&row(each)&":O");Indirect("O"&row(each));Indirect("K"&row(each)&":K");"CHECKOUT"))))
the formulas by #Martin!
From the above of the formulas by #Martin I try to modify a litle bit to ajustment to my kinda of my case I thought by trying to change the "SUMIFS" into "MINIFS" will comes out as I expected but well it's not. It's not working at all even close as I imagine it before. I was wrong because it's not for a MINUS function but in other hand it's like for another function to get a MINIMUM of number in a dataset.
What I want is to get a SUBTRACTION every each row of them SUBTRACT from the number of every below of each of them with the two conditions :
*first: based on the NAME on column "O".
*second: based on the criteria I desired and should be a certain value like CHECKOUT on column "K".
And I attached the link to explain more and than so you'll be understand what I mean is. And with the "expect output" in it hope can make this question more be clearly. Thanks in advance!
Please, feel free to edit My Example Quest of Spreadsheet

Isn't there anyway for you of differentiating that first values to be substracted from? (Or maybe eventually there would be more). For example putting "CHECKIN" to those values and "CHECKOUT" for all the ones that will diminish it. In that case you could modify that original formula and sum all the CHECKINs and substract from it all the CHECKOUTS
I've put it in a new tab of your spreadsheet, let me know if this could work for you:
=byrow(AF3:AF;lambda(each;if(each="";"";IF(OR(INDIRECT("K"&row(each))="CHECKIN";INDIRECT("K"&row(each))="CHECKOUT");sumifs(INDIRECT("AF"&row(each)&":AF");Indirect("O"&row(each)&":O");Indirect("O"&row(each));Indirect("K"&row(each)&":K");"CHECKIN")-sumifs(INDIRECT("AF"&row(each)&":AF");Indirect("O"&row(each)&":O");Indirect("O"&row(each));Indirect("K"&row(each)&":K");"CHECKOUT");""))))

Related

How do I get a cell to retain text, after the cell it pulls from changes text?

This question will have two parts. If you're willing to help me out, feel free to address whichever chunk you've got the time or interest for. Thanks in advance.
Assume there are two cells in a spreadsheet, the first (A1) has the text hello inside, and the second (A2) has =T(A1), so they now both say hello. If I want to change the text in A1, but want the text in A2 to continue to read hello, is there a way to automate this?
For some context, this is part of a larger project where I want to create a column of stock tickers that I like. Ideally, I could type the ticker name into a cell, check a box if I want to track it, and it would automatically add itself to a column. Where the first part of this question becomes relevant is that I would then move on to another stock, deleting the first ticker I wrote, but still wanting it in my column.
The second part of the question is about making the column. My instinct would be to use the =ARRAYFORMULA function, but that draws from a column to begin with, so I'm a little bit stuck.
Thanks
answer for Q1:
no, not possible unless you hardcode A2 as:
=T("hello")
or you use a script to remember your value but in that case, the A2 will host a custom function instead of the formula you mentioned
ofc what you are mentioning with those tickers, checkboxes and moving values around it's completely doable with a script
answer for Q2:
it depends on the formulae you use. not all formulas are supported under ARRAYFORMULA

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

Is it possible to select the next cell each day from a list in Google Sheets?

I know this is kind of an odd question, but I have a list of urls that I need to cycle through and display that url in a separate cell, and it needs to automatically change each day. And then finally, once it reached the end of the list to go back to the top of the list.
Is this something that is even possible to accomplish on Google Sheets, or do I need to take a completely different approach?
EDIT: Here is a rough example of what I am trying to do, and I honestly don't know where to start, so I haven't tried much yet. I know how to display the last row in a column, but I cant figure out how to auto change that last row each day. I feel like the best way to do this would be to either move the top row to the bottom each day, or vice versa, but I have no idea how to accomplish this.
Please let me know if you have any suggestions/if I can clarify anything... Any help would be greatly appreciated! Thank you!
Yes this very much possible, I have made one example sheet for you and you can make copy of the same.
Example Sheet.
E2 Contains Today's date, F2 contains date for comparison, G2 is the difference between 2 dates which will go on increasing daily, there will be automatic increment in the Column H.
Based on daily increment in Column H you will get your Urls in Column B.
You don't need to start list from the beginning again, you can go on adding list in Column A. However still if you will need then you can manipulate formulas by comparing another date.
Hope this will work for you.

Is there a way to use ARRAYFORMULA to find the most-recent even input of a column?

SOLVED EDIT
Thank you for the help. Solution here.
ORIGINAL POST
I have made a google sheet to describe the issue I am facing linked here (https://docs.google.com/spreadsheets/d/1yK6ZAX8BFnEqiuQO9HIxuY0l62ewDDccj-8EN1r2i2w/edit?usp=sharing).
I will also describe in words, below, the problem I am facing, along with the solutions I have tried.
The data of column A are random single-digit (0-9). I would like column B to show the most recent even number from column A, but only up to a specific row. That specific row is the row corresponding to the row of the cell in column B. In other words, in cell B7, I want to find the most recently entered even number of column A, specifically only on the range A2:A7 (A1 contains a column header).
This is actually a pretty simple formula, and I can get the desired outputs by simply checking if the value in a cell in column A is even and then returning the value of that cell if it is, or the output of the cell above if it isn't. So the formula would look something like: ​=IF(ISEVEN(A7),A7,B6)​
However, my problem is that the length of the data in column A will be growing as more data are entered, and my current solution of using the fill handle to copy the formula to new cells is inelegant and time-consuming. So my desired solution is to use an array formula entered into the first cell of column B (B2), capable of returning the same value as the other formula. The formula I tried to enter to perform this was the following: ​=ARRAYFORMULA(IF(ISEVEN(A2:A),A2:A,INDIRECT(ADDRESS(ROW(A2:A)-1,2))))​
However, as some of my previous work with arrays has taught me, not all formulas iterate as expected down the array. The formula seems to be able to return the correct output on lines which are already even, but it is unable to return the expected most-recently entered even number for all the other lines. It appears that the formula is not able to appropriately interpret the ​value_if_false​ argument of the ​IF​ formula.
I'm a little new to scripting, so I'm still trying to learn, but I also tried to dabble around with custom functions to no avail. I'm still wet behind the ears when it comes to coding, which is why I've been so lenient on the built-in formulas of Google Sheets, but I fear I may have reached the limit of what Sheets formulas can do.
I am open to trying new approaches, but my only real constraint is that I would really like for this to be a one-touch (or even better no-touch) solution, hope that's not too far beyond the scope of this issue. Any assistance would be much appreciated.
EDIT
After rubber-ducking the problem here, I went back and tried to use the OFFSET formula, hoping I could get it to play nicely with the array formula. Alas, I was unable, but I thought I should at least post my progress here for reference.
Attempt with offset
Still working at it!
Doing a vlookup on the row number seems to work for me
=ArrayFormula(if(A2:A="","",vlookup(row(A2:A),{if(iseven(A2:A),row(A2:A)),A2:A},2)))
Note: if there are no even numbers in range for some rows, it will produce #N/A for those rows.

Google Spreadsheet & ArrayFormula - auto-adding formulas

I'm having problems with something that is likey very simple to correct. I have a form that submits data to a Google Spreadsheet, simply a date, name and score. On a separate sheet I am going to have a leaderboard which shows all submissions ranked by highest score (for simplicity in the example in the link below, I just have the leaderboard showing up on the right of the same sheet). I have it sorting the data fine, but I'm struggling with getting the 'rank' value to display. As shown for the first 3 rows (G2, G3, G4) I know what the formula is to display the 'rank' value...but what I'm struggling with is how to get that value to show without having to have that formula in each cell. Since the data will be coming from a form, there will obviously be new rows added regularly which means the leaderboard will automatically get adjusted and I want all of the rows to display the rank #. From what I have read, ArrayFormula should allow this to work, but even with looking at examples I can't figure out how to get it to work with my formula.
I know I could just highlight the entire 'G' column and paste in the formula, and hope it adds it to enough rows...but then it displays 'N/A' for all of the rows which don't currenlty have any data.
Hoping its just a simple solution that I'm being dumb and missing...any help would be greatly appreciated. The link to an example is below. To summarize, for all rows that have content in column H and I, the G cell for that row should show the rank value automatically.
https://docs.google.com/spreadsheets/d/1pCIJQi5g2scOtB6o2PgVVb-0azzhupEOPjiL0RMM57A/edit?usp=sharing
Thank you!
=ARRAYFORMULA(RANK(INDIRECT("I2:I"&COUNTA(H:H)),$I$2:I,0))
This will automatically rank and sort, for all values, including additional ones that are added. You only need to enter it into G2, and it will dynamically fill in the rest for you.
You can use
IFERROR(RANK(...),"")
and drag it to all rows - this will leave blank cells instead of #N/As. I'm sure there are other ways but that seems like the easiest one to me.

Resources