Google Sheets: Query Question.

p_s

New Member
Joined
Sep 23, 2020
Messages
30
Office Version
  1. 2019
Platform
  1. Windows
  2. Mobile
  3. Web
Is there a way to use the query function where your reference can have more than 1 possible value?

Example:
Excel Formula:
=QUERY(IMPORTDATA(https://website.com/mydatasetURL.csv),"SELECT A, B, C, D, E WHERE C = '"&PossibleReferences!A1:A50&"'",0)

Is there a way to do this without putting 50 OR statements in the query. And will this work with an external data set?

PossibleReferences!A1:A50 are text string values

Also, if we put it the dataset in the query will it still update automatically? Or do I need to keep refreshing that sheet?
 
Last edited by a moderator:

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
So I found a solution that worked for me. But there is a limitation of 50000 characters in a join statement, and I have had 1600+ queries.

Excel Formula:
=QUERY(IMPORTDATA("https://MYURL.COM/sheet.csv"),"SELECT * WHERE Col1 = "&JOIN(" OR Col1 = ",FILTER(I:I,I:I>0)),1)
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,895
Members
449,097
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top