I'm working on a spreadsheet to help simplify job searches within the game industry. I have a list of 785 game-related domains, which I would like to search for keywords via Google, in groups.
Google limits queries to 32 words. A domain (like badrobot.com
) is considered one word, and operator words don't count towards the limit. Since I want to use search keywords in addition to multiple domains, I need to:
n
number of words from the available cap (32)n
domains from the listI have succeeded in writing a query that dynamically selects n
rows based on the wordcount, but I'm stumped by how to iterate this query output for the entire domain list.
[EDIT: thanks for the feedback @Tedinoz! Additional info following this comment]
Sample data, details following:
| UNIQUE DOMAINS (765) | JOB TITLES (21 WORDS) | ADD'L SEARCH TERMS (1 WORDS) | CAP |
|------------------------|------------------------|------------------------------|-----|
| 8circuitstudios.com | production coordinator | junior | 10 |
| acemaddox.com | producer | | |
| adhocla.com | associate producer | | |
| alderongames.com | project manager | | |
| alkimiainteractive.com | support technician | | |
| antstream.com | technical support | | |
| apocalypse333.com | operations specialist | | |
| apply.workable.com | operations coordinator | | |
| artificialrome.com | project manager | | |
| aweinteractive.com | project specialist | | |
| awem.com | operations associate | | |
| [...] | | | |
Expected single-query output, correctly grabbing the first 8 domains (again, counted as 1 word each), and then the 22 search words:
(site:8circuitstudios.com OR site:acemaddox.com OR site:adhocla.com OR site:alderongames.com OR site:alkimiainteractive.com OR site:antstream.com OR site:apocalypse333.com OR site:apply.workable.com OR site:artificialrome.com) (production coordinator OR production manager OR producer OR associate producer OR support technician OR technical support OR operations specialist OR operations coordinator OR project manager OR project specialist OR operations associate) (junior)
This query was generated using this formula:
=concatenate("(site:" & textjoin(" OR site:", 1, INDIRECT("$A"&2&":A"&D2)) & ")" & " (" & textjoin(" OR ", 1, $B$2:$C) & ")" & " (" & textjoin(" OR ", 1, $C$2:$C) & ")")
To iterate through the remaining 757 domains, the formula should output another 59 queries just like this one, which the user can manually visit at their leisure.
But without a for
or while
function in Sheets, I'm a bit lost how to begin attacking this. Is arrayformula
the key here? I'm having a hard time grasping exactly how it works.
Spreadsheet is here for the curious.
Much appreciate any advice you can give!
don't know if it's the best solution but the result seems to be OK.
=query({map(A2:A45,lambda(value,if(mod(row(value),10)=2,"(site:"&textjoin(" OR site:",1,indirect("A"&row(value)&":A"&row(value)+9))&") ("&textjoin(" OR ",1,B2:B)&") ("&textjoin(" OR ",1,C2:C)&")",
"no formula")))},"SELECT Col1 WHERE Col1<>'no formula'")
I used domains from A2 to A45 but you can extend this to your need.
Antoine