https://docs.google.com/spreadsheets/d/1VSiKZbD_PoQTfbav7spalkyBgrt4T8juaLlKOM7LgLM/edit#gid=0
I have two columns, A
and B
. Throughout this project, the same name will appear in each column. I want to be able to select the name from the dropdown list, and have it return the proper data.
I have the dropdown list working, the list contains all the names that appear in each column.
When I select "Mike", it returns the proper info, being that Mike appears in A
and in B
.
But when I select "John" or "Danny", I get the error message In ARRAY_LITERAL, an Array Literal was missing values for one or more rows.
The formula I have in E8
is
={QUERY(A1:B3,"SELECT * WHERE A contains """&E2&"""");QUERY(A1:B3,"SELECT * WHERE B contains """&E2&"""")}
How can I rectify this?
Best Answer
To avoid the error message you could wrap your formula with the
IFERROR
function:EDIT
Though the OP's closing question is "How can I rectify this?", I will follow the comment and explain.
What you want to do using the curly brackets
{}
, is to have your results displayed one under the other, like={1;2}
Only in this case, as an example for
John
, because your second query completes with an empty output it is as if you are asking for:which will result in an
#ERROR!
.Because you do not have simple numbers but handle queries, you get
Functions used:
QUERY
IFERROR