apps script sheets : First and last non-empty cell of the current row - google-sheets

I'm looking for a script that allows me to find the first nonblank cell of the current row (regardless of which row I'm in).
Once this cell is found, I would like to give it attributes like for example with setBorder.
I would then like to do the same with the last non-blank cell of the current row.
Finally, I would like to give another attribute to the cells in which I have data.
All this on the current row I'm on.
I hope someone can help me :) if I was not clear enough in my request, I remain at your disposal.
I thank you in advance.
good to you.

Related

Locking formula values in google sheets

Question
I'm trying to make a google sheet for calculating my net income over a set period of time. I have all the things but one thing figured out. That one thing being, I don't know how to lock a value in a formula to make it say the same for when I select and copy the cell formula to other cells. I'm very new to google sheets (and any form of excel) so I don't have much idea as for what I'm doing. Some help would be greatly appreciated, Thanks in advance. If my question wasn't very clear or needs rewording please let me know and I will work to correct whatever it is that is unclear.
Edit
So I've been doing some searching and working on the sheet, and I've decided to drop one of the things I was going to do because it didn't make much sense. So now the situation is that I need to have a value change dynamically as I continue to add more rows. What I'm trying to do now is have the cell formula change to add together the cell, say B3, and the cell above it, B2, and have that stored on another cell. I don't really know how to go about doing this, so any help or advice is greatly appreciated. Thanks in advance and sorry for the sudden change.
EDITED
Based on your edited statement with ...need to have a value *change dynamically* as I continue to add more rows. What I'm trying to do now is have the cell formula change to add together the cell, say B3, and the cell above it, B2, and have that stored on another cell, I suppose this is what is your goal (feel free to correct me if I'm mistaken) :
Example:
Used =SUM($B$2:B) on cell C2:
If you want to just copy the value and paste, I believe that is CTL+SHFT+v. If you want to copy the formula and paste it so that it refers to the same cells when it's copied, then you need to change the references so that they are static. For instance, if the formula refers to A1 and you copy it one column over it will change to A2, and if you copy it one column over and one row down it will change to B2. If the formula refers to $A$1, it will always refer to A1. You can do this manually, or you can highlight the cell reference and press F4 to change it to a static reference.
Hope I understood the problem correctly.

Sum of cells above the current one, including any rows inserted later

Now sure there may be better ways to do this but these are just questions of curiosity.
What is the placement of a cell itself called? Its address? Its placement?
Let's say I wanna add all the costs in D26 to D28 and show it in D29(total cell). I can just put in D29
=SUM(D26:28)
but let's say I'm constantly adding rows above under D28 but before D29. So instead I wanna make it so that the total cell can self-identify itself, then find the cell right above it, then add everything from D26 to the cell above the total cell.
=SUM(D26:28)
That is basically what I am trying to achieve.
Please answer if possible in a way that works for google spreadsheets.
This can be done with
=sum(D26:indirect("D"&(Row()-1)))
where indirect("D"&(Row()-1)) references the cell in column D with row number one less than the current row.
"D28" is called the address of a cell (in "A1 format", to be precise). The function indirect takes a string as its argument and returns the reference to the cell with the address given by that string.

Use last value from a specific Cell

I've looked everywhere for a solution with no joy and with no experience with Spreadsheet functions to figure this out myself, I've turned to asking it here.
Basically i need to display the previous value of a cell in another: I.E.
If cell B3 changes from 50 to 60, i need cell G3 to show 50.
I've tried:
=INDEX(B3:B; COUNT(B3:B))
with no joy.
we cant save data permanent when you delete your data in your sheet it wont save another place or it won't display anywhere

Swift code to loop through the table custom cell rows

I am looking for code in swift to loop through the table custom cell row (have 2 text boxes in row). These rows are dynamically created and on click of button, i want to read those text box values. I don't find good example for this in online, any help is appreciated.
Your thinking is wrong. You should not store any data in table view cells. The user can scroll them off the screen at any time and any changes to the data is lost.
You should really store the input from your table view cells into your model as soon as the user makes a change.

iOS selecting cell

This might be really easy to answer but I've searched the net, stack and books but cannot find what I need.
Basically I have a really noddy app with a table, the table has 5 sections and each section has about 5 rows, all I need is for some code to put in the Didselectrow procedure to tell me what cell was selected and then do something -
so if cell 2 then display map etc.
The selected cell is indicated by the index path parameter that you get in -tableView:didSelectRowAtIndexPath:. There's a category on NSIndexPath that gives you -section and -row methods; use those to determine the selected row and then take whatever action ou want based on that.

Resources