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.
Related
I would appreciate some help, please.
I have a google sheet with many tabs with data going horizontally.
I would like to create a formula that imports and transposes the data into a vertical list.
However, I want to be able to type in (or drop-down list) to select the tab which the transpose formula to look at. I cannot get anything to work. I have tried this
=TRANSPOSE(A1&!B2:J2)
To add to that if it could use a lookup (vlookup or hlookup) to find the correct row to transpose then that would be great also.
I have set up a test sheet below. Please help. Many Thanks Tim https://docs.google.com/spreadsheets/d/1Menn6Z1mLl8wYOrcdQFnfs7Lp0dbC9UJe1S3AQRcOS0/edit#gid=0
You should not use IMPORTRANGE to work with data that exists anywhere in the same spreadsheet. IMPORTRANGE is for use retrieving data from a separate spreadsheet.
Instead, delete your current Sheet1!A2 formula and replace it with this:
=ArrayFormula(TRANSPOSE(INDIRECT(A1&"!B16:J16")))
I also added a new sheet ("Erik Help") with an advanced formula that accomplishes your lookup using whatever is types in B1. If whatever is typed in B1 exists in Column A of the selected sheet, the results of that row will be retrieved. If no match is found, IFERROR will return "No Match Found."
That formula, in 'Erik Help'!A2:
=ArrayFormula(IFERROR(QUERY(TRANSPOSE(INDIRECT(A1&"!B"&VLOOKUP("*"&B1&"*",{INDIRECT(A1&"!A:A"),ROW(INDIRECT(A1&"!A:A"))},2,FALSE)&":"&VLOOKUP("*"&B1&"*",{INDIRECT(A1&"!A:A"),ROW(INDIRECT(A1&"!A:A"))},2,FALSE))),"Select * WHERE Col1 Is Not Null"),"No Match Found"))
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'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
In my spreadsheet using array formula I am creating a unique list of values based on multiple conditions. Formula is below:
{=INDEX(INDIRECT($O$3&"!$L$2:$L$"&$O$16),SMALL(IF((INDIRECT($I$3,FALSE)=$O$7)*(INDIRECT($K$3,FALSE)=$O$9)*(INDIRECT($M$3,FALSE)=$O$11)*(INDIRECT($X$17,FALSE)=$O$15)*(INDIRECT($AF$17,FALSE)>$O$15),ROW(INDIRECT($O$3&"!$L$2:$L$"&$O$16))-2,""),ROW()-20))}
Question belongs to this part if IF function:
(INDIRECT($K$3,FALSE)=$O$9)
Cell $O$9 contains drop down which includes one of cell content variables as well as <>, <>*, <> * Text*,""
When I use direct text match: specific column contains list of fruits and "apple" is one of the values, once $O$9 contains word "apple" formula works and I get a unique list. Should $O$9 contain any of above mentioned combinations (<>, <>*, <> * Text*,"") it gives me an error.
Question: How to change "=$O$9" so that it will be able to use following content of the $O$9 equals to <>, <>*, <> * Text*,"", etc.
Note: I cannot adjust drop down in cell $O$9 but can modify array formula only.
Thanks in advance!
Well this is by no means a complete answer but just to show my thinking:-
Suppose you have two column ranges which I have called AA and BB and you want to implement some of your tests based on $O$9. It would look something like this:-
=SUM((BB=1)*IF($O$9="<>",AA<>"",IF($O$9="<>*",AA="",IF(ISNUMBER(FIND("*",$O$9)),ISERROR(FIND(MID($O$9,4,LEN($O$9)-1),AA)),$O$9=AA))))
So what I am saying is that your (INDIRECT($K$3,FALSE)=$O$9) would have to become something like the contents of the brackets following SUM above.
I want to conditionally grab lines from a database-style spreadsheet in Google Spreadsheets (a list with a name, location, description, price) after checking the value with a vlookup - I've used this a while ago and expected it to CONTINUE an array across for the other columns next to the one 'looked up', but it seems my memory fails me here and it just retrieves the 'searched out' value.
=vlookup("Yes",'All 2014-15'!A2:G,2)
This formula basically finds the first value of the desired rows and should create a 'Selected items from 2014-15' list, but I can't work out how to expand it to produce a list of all the rows I want. Is there a simple way to retrieve this, I've tried playing with arrayformula but no success.
I can change the index simply to get the other values across, but if this could be filled out through an array too that would be preferable...?
Can you try this...
=FILTER('All 2014-15'!A2:G,'All 2014-15'!A2:A="Yes")
Edit:
As suggested by Immx, added apostrophes to sheet name and the second range changed to A2:G to A2:A assuming the yes/no data is in A column.