gSheet query concat (in select statement) and format two cells differently

dmj120

Active Member
Joined
Jan 5, 2010
Messages
310
Office Version
  1. 365
  2. 2019
  3. 2010
I created a dynamic file that finds our preferred vendor based upon two drop downs: type (device, oem, vendor and the corresponding "submenu."

In the query results, I'd like to concatenate 'Primary POC' and Title' into one cell- something like "select E,F,G,D,concate( P, " ", Q),R,T,J " ----"P" is the pirmary POC and "Q" is their title

And format and email as text (instead of a clickable email link), and the phone numbers to be consistently 000-000-0000 regardless if it's entered on the dataset tab as (800)555-5555 or 9991239876.

Sample file link: Copy of Preferred Vendors - Imaging/Ultrasound

Current query - I have several within an IF's for the dynamic aspect I'm creating.

Code:
IFERROR(
if(B3=lookupMenus!$F$4,QUERY(dataset!$A$2:$Y,"select E,F,G,D,P,R,T,U,J where B='"&$C3&"' and A=FALSE"), 
if(B3=lookupMenus!$H$4,QUERY(dataset!$A$2:$Y,"select B,F,G,D,P,R,T,U,J where E='"&$C3&"' and A=FALSE"), 
if(B3=lookupMenus!$J$4,QUERY(dataset!$A$2:$Y,"select B,E,G,D,P,R,T,U,J where F='"&$C3&"' and A=FALSE"), 
if(B3=lookupMenus!$L$4,QUERY(dataset!$A$2:$Y,"select B,E,F,D,P,R,T,U,J where G='"&$C3&"' and A=FALSE"),""))))
,"")

Thanks
Josh
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,224,906
Messages
6,181,665
Members
453,059
Latest member
jkevin

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