So I have a Googlesheet with multiple tabs: Tab1, Tab2, Tab3, etc...
I will ask the user to select from a dropdown of the tab options.
How do I make a query that chooses the same data range but from the tab that the user chooses?
For example:
=query(Tab1!$A$1:$Z$100, "select A, B, group by A")
But if the user selects Tab2 in dropdown, then I want the query to automatically become:
=query(Tab2!$A$1:$Z$100, "select A, B, group by A")
Basically same everything except the data range is now coming from a different tab.
Thanks
you need to indirect it... let's say the dropdown is in A1 then your query will be:
=QUERY({INDIRECT(A1&"!A1:Z100")}, "select Col1,Col2")
where ofc tab/sheet name = A1 dropdown option
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.
I'm using Google Sheets to try to create an invoice. Currently, employees fill out a google form that feeds to a Google Sheet (GS). I'm trying to create an easy way to make an invoice by selecting each client.
As you can see on this form, I have a ref tab set up so I can enter in billing addresses and such. My second tab in the GS is the invoice. And my third tab is the responses I get from the form.
I have the first part done on the Invoice form where I can select the Client Name and the billing information comes up. But I can't get the meat of the invoice to work. I want to only pull up certain columns off of the Form Response Tab if they match the client name. The closest I've gotten it to work is =QUERY('Form Responses 1'!B2:K, "A, B, C, D, E, F where 'Form Responses 1'!A2:A ' "& C5 &"' )")
Can anyone help?
See if this works
=QUERY('Form Responses 1'!A2:K, "Select B, C, D, E, F, G where A ='"& C5 &"'",0)
Also see the highlighted cell in the INVOICES tab.
Thanks in advance My question is detailed described below
I have two columns named as User Name and User Id in sheet A and Sheet B
Sheet A User Name Column is dropdown which I am referring from SheetB, if the user select any user name from SheetA dropdown, the associated User Id from Sheet B will be displayed in SheetA user Id column
This is sheet A:
This is my sheet B:
On the SheetA, cell G2, you can use the following formula:
=ArrayFormula(if(len(F2:F),vlookup(F2:F,'Sheet B'!A2:B,2,false),))
It will automatically update for the cells below in that column
For more information, see VLOOKUP
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}, ))
I created a dropdown list with a range in Sheet2 in Google Spreadsheets.
The dropdown is filled with a bunch of names.
When I select a particular item I want to update another cell next to it with the data that is on Sheet2 from another column.
For example Sheet2 looks like:
id,name,date
1,John,2015-04-29
2,Adam,2015-03-01
I select John in my dropdown list and I want to display the "date" column of John in another cell on Sheet1.
Assuming John is selected in C3 and your name/date data is in a range named NamedRange1 please try:
=vlookup(C3,NamedRange1,2,0)
If you wanted ID VLOOKUP would not be suitable as it does not "look to the left" and the conventional solution would be an INDEX/MATCH combination instead.