Autofill cells when a checkbox is checked - google-apps-script

I would like to be able to add names to the empty numbered cells when the checkbox next to the name is checked. When I uncheck a box, i would like the name removed and replaced with the next name that I check. The order the names show in the cells does not matter.
I honestly have no idea how to do this or if it is possible.
Spreadsheet image

Use filter(), like this:
=filter(D4:D, E4:E)
The formula assumes that the names are in column D4:E and the checkboxes in column E4:E.

Related

Automatic Replace "0" with blank cell

I have a sheet called "Test". Column B shows dynamic API calls, then I use a macro to copy all cells from Column B to Column C every 1 hour in order to store those prices, however sometimes API call fails, so it shows 0. I want to mass replace all cells containing "0" (match exact case) from all columns of sheet "Test" without changing Column B (which is the column for the API calls so we don't want to change its formula).
How can I do that?
Thank you!
Google sheets doesn't have this function yet but this could do the trick:
Select all cells (Ctrl + A) click Format > Conditional Formatting
Use the dropdown to select Equal To and type 0
Tick the text tickbox and change the text color to white, this will
effectively hide all your zero values.
You can define a format as
0;-0;

Do I need a script or a formula?

I am trying to have the formula look in Column A for not empty cells. (That part of the formula works fine.) Then return the name from Column B that's in the same row as the not empty cell.
Column A Column B
text/date Kelly
So if B has anything in it, tell me the name Kelly. I 've tried combining formulas, but I'm either not doing it correctly or maybe I need a script?
Here's the part that's working: =IF(A24="","don't meet","meet")
Of course, I want it to search the whole column, but I know for sure 24 has the text in the cell with a name so I was just playing around that line.
Answer is based on the description and document you provided and should give you something to work with.
This formula simple checks the entire Column A and returns values from the corresponding row from Col B if the Cell from the Col A row is empty/blank.
=ARRAYFORMULA((IF(A1:A<>"",B1:B,"")))
Here are example screenshots of your example data + end result
Though I'm not entirely sure what you'd like to happen if A has values on them. This formula retains A if it has content but you could always change the (A2:A="",B2:B,A2:A) part of the formula if you want something else to happen if A is not empty.
Give this a try, I put it in your sheet in the green area.
=ARRAYFORMULA(IF(A1:A15 = "", "", B1:B15))
Arrayformula applies the IF function to the entire range. So substitute A1:A15 with what ever the whole range is, A1:A600 or A1:A if you want to do the whole column. Make srue the second column has the same values but with B.
You can use filter() to filter your Column B if both column A and column B is not empty.
Formula:
=filter(B1:B,A1:A<>"",B1:B<>"")
Output:

Filtering name with two condition

I have a sample list of student and grades/subject in this file
enter image description here
https://docs.google.com/spreadsheets/d/1NeHlUaRnbvdJ2yJ38fUETGgBoYseQ8CuXmwRCwObAlM/edit#gid=0
On the range A16:A I'd like to see the list of names who has the grades of around 90-100 when I check any of the checkbox on B15:k15
the first example is when I check all of the boxes
I will only see the first name on the list because he is the only one with the 90-100 scores on all subject
2nd example when I check B15 and C15
I will only see the 1st and 2nd names on the list because he's those who only able to get a 90-100 score on those two subjects.
Is there a way to do this kind of filtering? thank you so much
Since this is your first post, I'm going to go with the approach I think you'll find easiest to understand. It's a long formula (which I've placed in a new sheet called "Erik Help" in A16), but it's just a repeat of the same element several times:
=FILTER(A2:K11, IF(B15=TRUE, B2:B11>=90, B2:B11^0), IF(C15=TRUE, C2:C11>=90, B2:B11^0), IF(D15=TRUE, D2:D11>=90, D2:D11^0), IF(E15=TRUE, E2:E11>=90, E2:E11^0), IF(F15=TRUE, F2:F11>=90, F2:F11^0), IF(G15=TRUE, G2:G11>=90, G2:G11^0), IF(H15=TRUE, H2:H11>=90, H2:H11^0), IF(I15=TRUE, I2:I11>=90, I2:I11^0), IF(J15=TRUE, J2:J11>=90, J2:J11^0), IF(K15=TRUE, K2:K11>=90, K2:K11^0))
The first argument of FILTER tells the function what to filter (in this case A2:K11).
After that, an IF statement is set up to check each checkbox. If the checkbox is checked, the FILTER will only include students who obtained a 90 or higher in that subject.
If the checkbox is NOT checked, then the student is automatically included (that's the part that says "B2:B11^0" etc., since anything to the zero-power equals 1, and 1 and TRUE are the same to Google Sheets). In other words, if no checkboxes were checked, then all students would read TRUE for all subjects, i.e., all students would be included (or, to think of it another way, no one is rules out). While the ^0 is not strictly necessary (i.e., any number other than zero is the same as TRUE), I think it's better formula practice and easier for others to understand if TRUE is represented either as TRUE or as 1.
I also set conditional formatting on A15:A, to bold the name as you had it. (The conditional formatting rule says, in English, "If anything is there, use bold.") You can see the rule by clicking anywhere in the range A15:A, then selecting Format > Conditional formatting from the menu and clicking the open the rule that appears in the window to the right of the screen.

Set default value after form submit in google sheets

I want to set a cell to a default value as soon as a form is submitted to a spreadsheet (I want to add a value after the last value from that the spreadsheet gives me).
Since upon a form submit it erases all the values in the row, I can't have a formula in this cell, I think I'd have to do it with AppScripts.
I tried doing it with onFormSubmit but I did not get very far with it. Is there a way to do this?
If the formula is going to be the same for each row, you could add an ARRAYFORMULA version of your formula in the second row of your Responses sheet. By putting your formula in the second row you can still add a header to that column.
For example, if you wanted to get the first three characters of whatever is in Column B, in the second row of the column you want your formula in (in your Form Responses sheet), you could use:
=ARRAYFORMULA(IF(B2:B="","",LEFT(B2:B,3)))
If it's just a default value you want in that column, then use something like this:
=ARRAYFORMULA(IF(B2:B="","",your_default_value))
Good luck!

How to display parts of value from database with different font size in SSRS report?

One of my columns has a value that looks like this -> "$5.95 (Park costs)"
and I need to display the value in column in SSRS report like this:
$5.95
(Park costs)
but font size of "(Park costs)" must be smaller than the price.
Is something like that even possible? To somehow make text that does not contain a number, dot or dollar sign smaller?
You can do this. You'll need to split up each component of the text column and then place each half in a placeholder. You can then format each placeholder individually.
This solution assumes that your column always contains a "(". If not you should be able to modify it to suit.
I Generated some test data and and placed it in a normal table (tablix) control.
I then added some new columns for testing that each part was working as expected.
The expression for "Cost" column is
=TRIM(LEFT(Fields!MyColumn.Value,InStr(Fields!MyColumn.Value, "(") -1))
The expression for the "Caption" column is
=TRIM(RIGHT(Fields!MyColumn.Value, LEN(Fields!MyColumn.Value) - InStr(Fields!MyColumn.Value, "(") + 1))
Once this was working OK I added the "Final Column".
To add a placeholder, click inside the textbox so the cursor appears then right-click and choose "Create Placeholder"
I added two placeholders with a space between then and set the values to the expressions above respectively. I then right clicked the placeholders chose "Placeholder Properties" and formatted each individually.
The final output looks like this. (I left the test columns in for clarity)