Query Function

tmiles101

New Member
Joined
Mar 8, 2022
Messages
3
Platform
  1. MacOS
Hi,

Moderator edit: Google Sheets question

I'm trying to use the following Query function =QUERY('Employee & Management Details Report'!A4:J458, "select B where J contains '"C2,C3,C4,C5,C6"')")
I want the formula to select the contents of Column B where Column J (in a separate tab) contains any of the items in Column C but I'm receiving an error. Anyone understand what I'm doing wrong here?
Screen Shot 2022-03-08 at 9.23.25 PM.png
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
In order to combine strings together, you need to use & in Google Sheets. For multiple criteria, you want to use matches

Excel Formula:
=QUERY('Employee & Management Details Report'!A4:J458, "select B where J matches '.*"&join("|",C2:C6)&".*' ")
 
Upvote 0
Oops. I made a mistake. Sorry I can't find where to edit my reply, or if it's even possible.

Excel Formula:
=QUERY('Employee & Management Details Report'!A4:J458, "select B where J matches '.*"&join(".*|.*",C2:C6)&".*' ")
 
Upvote 0
Solution
Oops. I made a mistake. Sorry I can't find where to edit my reply, or if it's even possible.

Excel Formula:
=QUERY('Employee & Management Details Report'!A4:J458, "select B where J matches '.*"&join(".*|.*",C2:C6)&".*' ")
Thank you so much!
 
Upvote 0

Forum statistics

Threads
1,224,885
Messages
6,181,574
Members
453,055
Latest member
cope7895

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