This question already has answers here:
Google Sheets Query Coalesce?
(5 answers)
Closed last month.
This post was edited and submitted for review last month and failed to reopen the post:
Original close reason(s) were not resolved
I want to select value in a2 if it's there, but if it's NULL I want to select value in b2
requested question
=query(A:B, "select B where A is null OR select B)
output obtained from #player0
=INDEX(IF(A:A="", B:B, A:A))
need to modify with index match
How to use INDEX MATCH along with this
any suggestions please
Try:
=INDEX(IF(A:A=""; B:B; A:A))
Related
This question already has an answer here:
I get Formula parse error with all formulas
(1 answer)
Closed 4 months ago.
I have a spreadsheet with registrations for a Summer Camp. I want to filter the registrations based on location, in a new spreadsheet.
I have used the following code:
=QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1BDv-P3Bx8kHLSEUILmFBMmSB502-LUkQ8oiw8BYaPyo/","Inschrijvingen!A2:W2800"),"SELECT * WHERE Col1 contains 'Amersfoort - Groep 1-2'")
It keeps on saying: error.
The second image is the main file with all registrations.
In the event your spreadsheet locale uses comma , instead of period . as decimal mark, you will have to use semicolons ; as formula argument separators, like this:
=query(
importrange("1BDv-P3Bx8kHLSEUILmFBMmSB502-LUkQ8oiw8BYaPyo"; "Inschrijvingen!A1:W");
"where Col1 contains 'Amersfoort - Groep 1-2' ";
1
)
You can choose the spreadsheet locale at File > Settings > Locale.
This question already has answers here:
Repeat whole row N times based on column value in Google Sheets
(2 answers)
Closed 4 months ago.
I have a list of users and a value that denotes how many times I want to return the user's name.
How do I set up a formula that helps me output this?
try:
=INDEX(QUERY(FLATTEN(IFERROR(SPLIT(REPT(A2:A&"×"; B2:B); "×")));
"where Col1 is not null"; ))
This question already has answers here:
Query is ignoring string (non numeric) value
(2 answers)
Closed 5 months ago.
I have a simple Query that groups my data by months that was working fine before, but now that I've introduced a formula into my date column, it's not working anymore. (I'm guessing it's because the majority data in the column is now formulas instead of actual dates).
=Query(C5:L,"SELECT SUM(I) pivot MONTH(C)+1",1)
Is there a way for me to still get my intended Query data without removing my formulas in the date column? (Query formula is in M2)
Thank you in advance!
Link to sheet: https://docs.google.com/spreadsheets/d/1EpvLMboKJ0KeR7tTqBarF1AnAg3jelhKTkyBhwKNlK4/edit#gid=1335125620
Your formulas in Col C seem to be causing the issue since they're adding a blank space when there is no corresponding value in Col D:
=IF(D45=""," ",TIMESTAMP())
Instead, try:
=IF(D45="",,TIMESTAMP())
This question already has answers here:
Query is ignoring string (non numeric) value
(2 answers)
Closed 5 months ago.
Here is a copy of my sheet https://docs.google.com/spreadsheets/d/1b7ofD9f02yKiIvGYfCBi_GdhkRtgTAoY2NpftJmZaDQ/edit?usp=sharing
So my query is on the front tab 'Overall' in D1
=query(Data!A1:G,"SELECT * WHERE 1=1 "&IF(A2="All Raids",""," AND A contains "&A2&" ") &IF(B2="All Classes",""," AND LOWER(B) = LOWER('"&B2&"') "),1)
On the datasheet, I have people listen in raids 1,2 and 3.. and it works fine. However, if I were to change a value to something like BWL1 or BWL2, it will not display.
I got this code from a youtube tutorial, so I don't understand it 100%, but basically the "a2=all raids","" part is just to remove any filters, then the remaining is filtered by my drop-down menus, &A2& and &B2&.
Any ideas?
I've tried using A CONTAINS "&A2" instead of A = "&A2&", I just cant figure out a workaround to where any value (numberical+lettered) listed in my Datasheet column A works.
Thank you in advance for your time, I hope this makes sense :)
That's a known issue with query() function: query() has trouble with mixed datatypes (numeric and text in column A). To avoid this you can convert column A to text. See if this formula works
=query({ArrayFormula(to_text(Data!A1:A)), Data!B1:G},"SELECT * WHERE 1=1 "&IF(A2="All Raids","", " AND Col1 contains '"&A2&"'") &IF(B2="All Classes",""," AND LOWER(Col2) = LOWER('"&B2&"') "),1)
Note that, because of the use of 'contains' when '1' is selected in A2, it will also show rows containing BWL1. If you don't want that, change 'contains' to '='.
I use a form with a simple question.
Question 1: Which channel has an issue? (The user has to choose an answer in a list)
Question 2: "what is the issue" (and the answer is a free comment)
Now the answers are sent to a specific worksheet named "answers" with:
Column A: timestamp
Column B: Answer question 1
Column C: Answer question 2
In this same Google sheet, I have another worksheet (GLOBAL) with the global channel list in column A, and a column for the specific issue comment.
As I didn't find a way to provide the answer of a google form in a specific column of a sheet, I am searching for a way to:
"start when a new answer is added in the "answers sheet"
"identify the channel recently added and search for this value on the "GLOBAL" worksheet"
When the value is found, I want to add the value of column B and column C of "answers sheet" to the corresponding columns on the "GLOBAL" worksheet.
Do you have any idea on how I can do that as I am not an expert
Thanks a lot
not sure what you asking for but VLOOKUP is your friend:
=VLOOKUP(F2, A1:C, 2, 0)
look for A2 in range A1:C and return 2nd column from that range.
=VLOOKUP(D4, sheet2!A2:B, {2,3}, 0)
look for D4 in range A2:B of other sheet called "sheet2" and return 2nd and 3rd column from sheet2
=ARRAYFORMULA(VLOOKUP(X2:X5, C1:C, 1, 0)
look for range X2:X5 in C1:C and return 1st column from range C1:C if there is match
=VLOOKUP(IMPORTRANGE("ID", "Sheet1!A1"), IMPORTRANGE("ID", "Sheet5!F1:X"), {2,6,7}, 0)
etc...