I'm trying to build a formula to select a different set of data dependent on what is selected in a drop-down menu list, for example: if I select option 1, I want to retrieve data list 1 which starts at A1, but if I select option 2, I want to retrieve data list 2 which starts at G1.
Replace B1 with the location of your drop-down menu:
=transpose(split(arrayformula(ifs(B1=1, concatenate(A:A&","), B1=2, concatenate(G:G&","))), ","))
Next time, show the research and work you have done so far.
all you need is simple IF statement like:
=IF(B1="option 1", {A1:A},
IF(B1="option 2", {G1:G}, ))
Related
I have a Google Sheets where I would like to have drop down menus in a column. When a choice is made in a drop down menu, I would like it to be no longer present in the others.
So I added a query function to subtract the values already selected. This works fine but I get an error message saying that the value is no longer present in the specific range. And this is quite normal as I am feeding the drop down menus with the data from the query function. And when I select a value in my dropdown, it disappears from the column where the query function is located.
So I would like to know if there is an alternative to not have the error message (either hide it or use another function).
Here is my sheet before filling in my drop-down menu :
And here it is after :
Here is my function:
=query(query({A2:A;C2:C}; "Select Col1, count(Col1) where Col1<>'' group by Col1"); "Select Col1 where Col2=1")
And here is the link to my Sheets if you want to check it out for yourself.
Thanks in advance for your help
Use a dedicated range for defining the available values per each drop-down separately. Insert columns to the right and use these formulas:
cell D2: =transpose(A2:A)
cell D3: =transpose( filter( A$2:A; isna(match(A$2:A; C$2:C2; 0)) ) )
Copy the formula in D3 down. Select cell C2, choose Data > Data validation and set the "List from a range" to =D2:N2. Save and reopen the dialog box to remove the dollar signs that appear by default.
Then copy cell C2 down.
how can I make a drop down list in google sheet dependent on other data ?
I added a picture and shared the google spreadsheet to make things clear :-)
https://docs.google.com/spreadsheets/d/1t3PeVcAFnh4SU9CrxrX4_jjFq-EtkQvJmdTdXTVCeSE/edit?usp=sharing
Drop Down List A --> Show the list based on what is written in A1
or
Get Drop Down List A by value in A1
After that a picture should show up in the next column based on the value of the drop down list.
Hope you can help?
place this in M3:
=TRANSPOSE(IF(B3=$F$3, $G$3:$G$5, IF(B3=$F$4, $I$3:$I$5, IF(B3=$F$5, $K$3:$K$4, )))
in C3 create data validation from M3:3 range
use in D3:
=INDEX(IFNA(VLOOKUP(C3:C, {G3:H;I3:J;K3:L}, 2, 0)))
I've tried looking for an answer to this online for a few hours now, but I just can't work out how you'd describe it, or find an appropriate answer.
I have a spreadsheet where I'm wanting to pull out an ID in Column A into a separate tab, but only if it contains a certain phrase that's contained in Column E. In this separate tab, I then don't want there to be any gaps in between the IF statements.
So for example I want the next tab to pull through the Action ID if column E contains 'Client'. If it doesn't, it searches the next row and so on until it finds one that does contain 'Client'. Row 2 on the separate tab would then continue the search, but it wouldn't be filled with something if it doesn't find the word 'Client' - it instead would continue searching down until it found one that has the word in.
So for example - if the first ID that contains the right phrase is in Row 5, I want it to appear on the separate tab in Row 2, underneath the heading. Then, if the second ID with the correct phrase in column F is in Row 11 for example on the main tab, I then want it to be pulled through to Row 3 on the separate tab. And so on..
This will then allow me to do lookups for the rest of the values I want to input on the separate tab.
I've tried as many different IF statements as I can, but it's just not having it.
Any advice would be really appreciated.
You can use INDEX and AGGREGATE combination:
=IFERROR(INDEX($A$2:$A$6,AGGREGATE(15,6,1/($E$2:$E$6="Client")*ROW($E$2:$E$6)-1,ROW()-1)),"")
In Google Sheets you can use FILTER (docs) for that. Place it in the top cell of your column.
={
"Your Header";
IFNA(FILTER(A2:A, B2:B = "Client"))
}
If A2:A and B2:B are from other tab named My Tab it will be 'My Tab'!A2:A and 'My Tab'!B2:B.
I am using google sheets to do the following.
Sheet 1 : 1 column for each person who needs access to the file. Each column's cell has a dropdown menu so people can select what items they have.
Sheet 2 : A list of every item in column A, columns B through G are the names of the people.
What I am trying to do is to have on sheet 2, the words "YES" or "NO" appear under each person's name if they have selected the item whatever the order.
So if Person 1 picks in the dropdown of sheet 1 that they have Item 1, Item 3, Item 2 in this order, I want sheet 2 to show the "YES" or "NO" mention. I don't want the order of the items in the list to be an issue.
So far, I have tried these 2 methods :
=IF('Sheet1'!A2:A25=A2;"YES";"NO")
=IF(RegExMatch('Sheet1'!A2:A25;A2);"YES";"NO")
These do not work as the items must be selected in the same order as they appear in the second sheet. Is there another function that can validate a list in any order and apply the appropriate value?
Thanks ahead!
Jason
Edit : https://docs.google.com/spreadsheets/d/1cNn7G9x9o56d_9qM18s3AULkhpfOV5Y-b55vycCUyLY/edit?usp=sharing
Sheet2!B2:
=ARRAYFORMULA(IF(ISERROR(MATCH($A$2:$A$100;Sheet1!A2:A25;0));false;true))
MATCH Sheet1A column against Sheet2A column
IF MATCH returns error, FALSE, else TRUE.
I need to populate a drop down list in a cell (let's say cell B2) of Spreadsheet A (using data validation) on basis of data located in Spreadsheet B (range - C3:C15).
How do I do that? Googled this for several hours - no luck.
Thank you.
Getting the items from another workbook, as opposed to another sheet in the same workbook is similar. It's a two-step process. First, you need to import the data you want to use for the validation items into the workbook where you want to make use of it, then connect it up as described in #uselink126's answer.
An example: Workbook 2 contains a list of fruit names in no particular order. The list has been assigned a named range Fruits for readability, but this isn't necessary. Workbook 1, Sheet 1 has a column of cells where we want to populate a drop-down with the items from Workbook 2.
Step 1 - Importing the data
Add another sheet to Workbook 1 and insert the following formula into cell A1:
=ImportRange("<key>","Sheet1!Fruits")
where <key> is the unique ID Google docs assigned when you created the spreadsheet. In the example, the items are sorted into alphabetical order as part of the import, and to do this you would enter instead:
=Sort (ImportRange("<key>","Sheet1!Fruits"), 1, true)
The 1, signifies column 1 is what to sort by, true means sort ascending. The cells in column 1 should populate with the sorted fruits.
Step 2 - Point the data validation to the imported list
On Workbook 1, Sheet 1, Select the cells you want to have the fruits as their drop-down data source.
- Right-click the selection and click on Data Validation from the menu. Set Criteria to List from a range and enter Sheet2!A1:A20
That's it. The drop-down chevrons should appear in those cells and when clicked the list of fruits should appear.
Note that this is "live" - adding an item of fruit to Workbook 2's list will also magically add it sorted in the drop-down list.
The format to access cells from another spreadsheet in Google Sheets is:
SheetName!CellAddress
For example, let's say you have a Google Sheet that contains 2 spreadsheets named: Sheet1 and Sheet2 (The names are listed on the tabs at bottom left hand side of each sheet).
In Sheet1 if you wanted to access cell B2 in Sheet2, you reference it by inputting: Sheet2!B2
In Sheet2 if you wanted to access cells C3:C15 in Sheet1 , you reference those cells by inputting: Sheet1!C3:C15
To specifically add cells from another sheet to a dropdown:
1) Select the cell you want the dropdown in
2) Right click on the cell and select Data Validation
3) In the dialog box, click the grid image in the Criteria input box
4) This will bring up the "What Data?" dialog box
5) Click on the tab for the sheet you want to access
6) Hold down shift and click on the cells you want to select (you will see the cell addresses show up in the input box in the "What Data?" dialog)
7) Click OK and you are set. The data will update if you make changes in the source sheet.
More info: https://support.google.com/docs/answer/186103?hl=en
Similar to rossmcm's answer but with a few tweaks because his answer didn't work for me:
=IMPORTRANGE(spreadsheet_url; range_string)
Where spreadsheet_url is The full URL of the spreadsheet from where data will be imported, and range_string a string, of the format "[sheet_name!]range" (e.g. "Sheet1!A2:B6" or "A2:B6") specifying the range to import.
Example:
=IMPORTRANGE("https://docs.google.com/spreadsheets/d/1EwEn_2dSbgAlR7jJ7UT_MyE3h1-Biq3qoovfIGUnVlo/edit#gid=0", "Sheet1!A1:A7")
More info from Google DOCS Help!