Suppose I have a table with 3 columns in a Google Spreadsheets sheet. Col1 is a name and Col2 and Col3 are numbers. Can we use a column range for number comparison such as in the example below? (what I've written below obviously doesn't work)

select * where Col1='John' AND Col2 to Col3 > 0

Is there a way to achieve the same result?

1 Answer 1


Google Query Language hasn't a to operator.

Instead of Col2 to Col3 > 0 try Col2 > 0 AND Col3 > 0


  • Thank you Ruben. I'm actually going through the reference now. The issue with my case is that I have a lot of columns I need to compare > 40. It would just be a drag to write all of them Col2 > 0 AND Col3 > 0 AND ... AND ... AND ... Col51 > 0 ... I was looking for a way to specify a range instead of individual columns.
    – Hantu
    Jun 28, 2018 at 9:12
  • Probably no way around it though. I'll just mark this as the answer. Thank you!
    – Hantu
    Jun 28, 2018 at 9:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.