0

I am trying to get rid of #VALUE! prompts from the QUERY function in Google Sheets. The closest question I could find was this one below, but it won't answer my question:

Google Sheets Query Get Row When Any of These Cells are Not Empty

Basically, what I am trying to do is to set a Sheet1 as a combination of attributes that the user enters plus a few more from another table, Sheet2. Here is an example where Sheet1 picks up entries from fields2, 3 and 4 from Sheet2:

https://docs.google.com/spreadsheets/d/1CiGUw9YkVfzHS2jfwIVw4OQD3Xjf_74HEMoUsddpBLQ/edit?usp=sharing

I want to use this as a template that people fill in, then download as a .csv, but the next step will fail due to the fact that there are empty values in the QUERY from drag+dropping the formula which will produce #VALUE! strings in the .csv output. See screenshot:

enter image description here

How do I turn the QUERY formula from the current one, e.g.:

=QUERY(Sheet2!A:D,"SELECT B WHERE A = " & A2, 0)

Into something that leaves the cells empty, so that when exporting as .csv, it won't produce the #VALUE! rows like below:

enter image description here

  • 2
    Indeed, wrapping up the QUERY formula with IFERROR() solved the problem. Thanks. – 719016 Mar 12 '18 at 16:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.