Using OR statement within Query Importrange function?
Clash Royale CLAN TAG#URR8PPP
Using OR statement within Query Importrange function?
I have a spreadsheet that I use to track orders for our business. Within this sheet, there's a cell that contains a data validation list with various statuses for the order.
I am attempting to set up a secondary sheet for our delivery person to view only orders that are currently anything other than "Delivered", "On Hold" or "Canceled" status.
Other statuses are "New", "Packed" and "Pending".
What I have so far is the following:
=query(IMPORTRANGE("1CtEslspJ0qmsEc94q6RT6JW7ODxCrTK3MbI2wDF8BUE","'Order Tracker'!A:I"),
"select Col1, Col2, Col3, Col5, Col6, Col9 where Col3 = 'New'",-1)
This works great to pull all orders that are New, but obviously I need more than that. Not sure how to proceed because I tried inserting an OR() statement with the where Col3 is, but it spat errors no matter what I tried.
Thank you in advance!
1 Answer
1
All you need to do is update your WHERE clause to use the word OR, not the function. So
WHERE Col3 = 'New' OR Col3='Packed' OR Col3='Pending'
WHERE Col3 = 'New' OR Col3='Packed' OR Col3='Pending'
I suppose to be technical and allow for other statuses you might focus on ANDing cases where it does not equal Delivered, On Hold, and Canceled.
WHERE Col3 != 'Delivered' AND Col3 != 'On Hold' AND Col3!='Canceled'
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
you could also create a drop-down list and reference them one by one, adding each variable when it is required.
– Datanovice
Aug 12 at 17:40