S H
S H

Reputation: 31

Google Sheets Query, 'where' condition not working?

I'm trying to separate specific rows of data into a new sheet, based on the text string in Column H / 8;

=query({attendees_list!A2:N2},"select Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8,Col9,Col10,Col11,Col12,Col13,Col14 where Col8='Show1 - Adult (Earlybird Pricing)'",1)

The query is working, in that it returns columns 1-14 from the 'attendees_list' sheet, but it doesn't seem to be applying the "where" condition, as its returning all rows regardless of the Column H value, rather than returning the specified value; 'Show1 - Adult (Earlybird Pricing)')

Here is a document with the example of the issue https://docs.google.com/spreadsheets/d/1LEISiYnFeOloA5FDmzA3B5fhXVY_YJiivxedR5qurpU/edit?usp=sharing

I've tried different string quote types (ie; ''&"") but I can't figure out the issue. Any idea where I'm going wrong here?

Upvotes: 0

Views: 1012

Answers (1)

player0
player0

Reputation: 1

the issue is in the range A2:N2 <- that's one row and then 3rd query argument set to 1 will treat that single row as a header row and always output it whatever you setup in 2nd query argument

try:

=QUERY({attendees_list!A2:N},
 "select Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8,Col9,Col10,Col11,Col12,Col13,Col14 
  where Col8 = 'Show1 - Adult (Earlybird Pricing)'", )

Upvotes: 1

Related Questions