I'm trying to create a live quiz with results from a Google form. It inserts rows into my custom sheet, but one of the values which is a sum() of specific cells is ignored on insertion, is there a way to set the default value of a specific cell when a new row is inserted to the specific sum formula I require?
I have seen various examples but all are more complex than I need an I am unable to unpick them.
Is it also possible to specify a checkbox in a cell as well?
try:
={"TOTAL"; ARRAYFORMULA(IF(A9:A="",,MMULT(FILTER(D9:CE,
MOD(COLUMN(D9:CE)-1, 2)=0)*1, ROW(INDIRECT("A1:A"&COLUMNS(D:CE)/2))^0)))}
spreadsheet demo
Related
We use a sheet to look up information. There are 936 rows and will get more as time goes on, however the query returns a blank result (as it should) after row 600, how do i change what the search/lookup area so it will search the whole table on a separate sheet and return the results?
=IFERROR(IF($D$5=""," ",INDEX(allvehicles2,(MATCH($D$5,indexes2,0)),7))," ")
Tried to alter the selection and even moving to another sheet but would not return the results.
If you are able to, try using Tables with the XLOOKUP function.
It simplifies the formula and the table will automatically grow as data is added to it.
This ensures that the formula will use all the data.
Make sure that the data you are using to lookup against is continuous.
That is no empty rows or columns.
Ensure that it has headings.
Turn it into a table by selecting it and pressing Ctrl + T.
You can change the name of your table by selecting the data and not the headers.
Then use the Name box to change the name.
Then use the XLOOKUP function, with the lookup_array and return_array values each being a column in the table. If the value is not found, an empty string will be returned.
Formula structure
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found])
Example formula based on the screenshot
=XLOOKUP(A2,MyTableName[Key],MyTableName[Value 6],"")
i'm trying to create a dropdown list that return the values of a big table if a certain criteria is true:
For example, in this example I need the dropdown to list all the names which city is "Bilbao".
If I create a sheet that "lists" all the posible dropdowns (one for each city with the names listed below), there's no problem. But I'm trying to don't use that sheet, I mean, that the dropdown directly calculates the correct list as an array and show it. That's because the real workbook has more than 100 "cities" that can change at any time.
Is it possible or maybe i'm overcomplicating that?
Regards!
You'll need to use a range that your filtered list of values appear in.
The formula =FILTER(Sheet1!$A$2:$A$11,Sheet1!$B$2:$B$11=Sheet1!$D$2) will return just those names that appear in the city shown in D2.
To use it in your data validation add a named range to the Name Manager (Formulas > Name Manager). My formula is in cell G2, so my named range looks at =Sheet1!$G$2# and is named CityFilter.
Now create your Data Validation to look at CityFilter.
Excel 16.x for Mac
I have a situation where we have a tabular spreadsheet template for requisitions. The spreadsheet is copied for each project and filled out. Each spreadsheet will have multiple rows - from 1-400. Each row has columns with data validation rules.
The issue is that I cannot figure out how to enter a formula that generates a different list for each row the data validation formula entry.
eg:
Each row will have a "Facility Code" and a "Building Code". The "Building Code" list is generated by what is in the "Facility Code" cell. The problem is that the data validation rule wants a range of cells, not a formula that generates an array. With sometimes 400 rows, I would need to create 400 different lookups based on the R(n):Facility_Code entry.
Dynamic List for Facility Code (in Template!P4):
=UNIQUE(FILTER(NFS_Facilities[Facility Code],(NFS_Facilities[Facility Code]<>""),""))
Dynamic List for Building Code:
=UNIQUE(FILTER(NFS_Facilities[Facility Code],(NFS_Facilities[Facility Code]='Template'!P4),""))
The P4 is the issue here as it will change by the row.
The Data List validation points to a range of cells.
The current behavior is on R1, it works fine. On R2, no matter what is entered into "P5", it generates the data based on P4 (as it should as that is what is in the formula).
Is there any way to have the Data Validation formula be dynamic based on the R(n)? The intent is to have the Data Validation range be a dynamic formula replacing P4 with tableName[facilityCode]
...Ignore my previous answer.
Putting a FILTER isn't going to work inside a DV with a dynamic reference for some reason.
You'll need a hidden sheet, and in that sheet each row on the input sheet will have a corresponding row of options. They key is to use =TRANSPOSE() around the FILTER() to make the results in rows not columns (so they don't cause #SPILL! errors.
Once you have that setup, just point the DV to the sheet with a spill reference (with a # behind it): example in Sheet BUILD_CODE_OPTIONS!A4:
=TRANSPOSE(UNIQUE(FILTER(NFS_Facilities[Facility Code],(NFS_Facilities[Facility Code]='Template'!P4),"")))
then in the DV for the Building Code field on row 4:
BUILD_CODE_OPTIONS!A4#
You'll need a sheet for every column you want a dynamic drop down in.
... now just waiting for MS to fix the bug preventing the FILTER in the DV ...
My spreadsheet is collecting data from a form
On another tab I'm showing the responses that match "Lesson day" with "Today's date" (in the example, all the lessons are showed).
As you can see, the "e-mail" field is filled out only once.
Is there a way to automatically fill the "e-mail" field in the second tab? Maybe matching the "Student Code" with the "e-mail" fields in the first tab?
I've tried the MATCH() function but it returns only the position. I feel like I need to combine MATCH() with other functions but I have no idea about where to start
EDIT: Having the email adresses on another column would work too.
SOmething like: if the "Student Code" in the 2 tabs matches, show the email adress for that "Student code"
try:
=ARRAYFORMULA(IFNA(VLOOKUP(D4:D, FILTER({form!E2:E, form!G2:G}, form!G2:G<>""), 2, 0)))
change form to match the sheet name of your form sheet
As suggested, I created an auxiliary table (just called Sheet7) and getting closer to the desired result
In A column I used
=UNIQUE(Lessons!E:E)
In column B I used
=INDEX(Lessons!A:M, MATCH(A2,Lessons!E:E,0),7)
Then, on my second spreadsheet, I could get all the e-mail adress using the following formula
=INDEX(Sheet7!A:B, MATCH(D4,Sheet7!A:A,0),2)
I've tried to use ArrayFormula on the auxiliary table
ARRAYFORMULA(if(A2:A="",,INDEX(Lessons!A:M, MATCH(A2:A,Lessons!E:E,0),7)))
But it doesn't work. It shows only the email adress matched from the cell A2, ignoring A3, A4,...
A different approach:
Make an extra column in your form responses sheet called "Student E-mail".(In this example it is column "I")
In row 2 of that column, write the following formula:
=ARRAYFORMULA(IF(ISBLANK(G2:G),VLOOKUP(F2:F,INDIRECT("F$2:G"&ROW(I2:I),TRUE),2),G2:G))
Use that column for the emails in your other tab (hide the original email column)
Update:
Using array formula, you don't have to manually drag & drop. And it keeps going as new rows are added.
Usually MATCH is combined with INDEX
You should build an auxiliary table with one column for names and another for ee-mails.
To build the auxiliary table from the collected data you could use something like this
=UNIQUE(FILTER({Lessons!E:E,Lessons!G:G},LEN(Lessons!G:G)))
The above is better than using a formula for each column as this prevent having mismatching data.
INDEX / MATCH usually doesn't return the "expected" results in an ARRAYFORMULA. Instead use VLOOKUP.
NOTES:
Please bear in mind that every time that you edit a value the formula will be recalculated. If you have a lot of formulas (like when doing a fill down to copy a formula to all the cells in a column) or having an ARRAYFORMULA with open ended references i.e. G2:G this could affect your spreadsheet performance.
If you go for using an ARRAYFORMULA, use ARRAY_CONSTRAIN to limit the number of rows returned by your formula.
Related
How to map values between columns in worksheets
I have a Google sheet where I receive the data automatically from a software. Basically it adds a new row and with data in each column. Now I have to add manually a column and I want to add a formula to each new row. I'm using IF to leave the cell blank if G1401 is empty.
=if(G1401="", , ifna(CONCATENATE(G1401," - ",H1401," - ",J1401)))
But i have to drag the formula for the cells I want and thats THE problem. If I drag the formula, when the software sends a new row, it's assuming that I already have a row filled with a formula and write in the next one without the formula.
What I want is something similar to FILTER function to be able to not use the drag cell formula to use it or something similar.
use in row 2:
=ARRAYFORMULA(IF(G2:G="",, G2:G&" - "&H2:H&" - "&J2:J))