Avatar of Doug Haselwood
Doug Haselwood
Flag for Australia asked on

Help to make a Boolean Search string from an Excel Row

Please see sample - I have a spreadsheet attained from a marketing database which I want to create a Boolean search per ROW for.

Sample.xlsx

As you can see - the sample data will have varying data in it and needs to have the format (From A2 example)

 
IDName1Name2Name3Name4Name5Name6Name7Contact Number1Contact Number2Contact Number4Contact Number5Email1Email2Email3Email4Address1Address2Address3Address4Address5Address6Address7Address8Address9Address10Address11Address12Address13Address14
123245678JedBush




088490033


jed@gmail.com


123 Fake St Springfield12345WAUSAEarthMilkyWayGalaxyNearAndromeda



It needs to look like:

12345678 OR "Jed Bush" OR 088490033 OR jed@gmail.com OR "123 Fake St Springfield WA 12345 USA Earth Milky Way Galaxy Near Andromeda"

So names and addresses need to be concatenated and wrapped in quotes however contact numbers and email addresses need to be separated by an 'OR' statement

 
876543213BarbaraValentineBush



095747773234890230

Babs@gmail.combarbara@hotmail.com

321 Varsity DriveWilmington12345VA










So this would look like:

876543213 OR "Barbara Valentine Bush" OR 095747773 OR 234890230 OR babs@gmail.com OR barbara@hotmail.com OR "321 Varsity Drive Wilmington 12345 VA"

Thanks for your help,
* Excel TableMicrosoft Excel* booleanMicrosoft Office

Avatar of undefined
Last Comment
Gary Benjamin

8/22/2022 - Mon
Doug Haselwood

ASKER
FYI - I have this formula I've put together - however its so... terrible

=A$2&C2&""" OR """&CONCAT(Table2[@[Name1]:[Name7]])&""" OR "&Table2[@[Contact Number1]]&" OR "&Table2[@[Contact Number2]]&" OR "&Table2[@[Contact Number4]]&" OR "&Table2[@[Contact Number5]]&" OR "&Table2[@Email1]&" OR "&Table2[@Email2]&" OR "&Table2[@Email3]&" OR "&Table2[@Email4]&""" OR """&CONCAT(Table2[@[Address1]:[Address14]])
zorvek (Kevin Jones)

This isn't much prettier than yours but it's a start:

=TEXTJOIN(" OR ",TRUE,Table2[@ID],""""&CONCAT(Table2[@[Name1]:[Name7]])&"""",Table2[@[Contact Number1]],Table2[@[Contact Number2]],Table2[@[Contact Number4]],Table2[@[Contact Number5]],Table2[@Email1],Table2[@Email2],Table2[@Email3],Table2[@Email4],""""&CONCAT(Table2[@[Address1]:[Address14]])&"""")

Kevin
ASKER CERTIFIED SOLUTION
Gary Benjamin

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23