Triggering a function with a dropdown - Functions and Scripts for Google Sheets <p>Thanks for the support so far. </p> <p>I've had a look but available information seems a little different to what I'm looking for so I'd very much appreciate a few pointers.</p> <p>Sheet I'm working on: <a href="https://docs.google.com/spreadsheets/d/1K8QhVKWSsvHTFKDHNv3ySb5bcaU9I7tczIZvIkegbw0/edit#gid=1778672780" rel="nofollow">https://docs.google.com/spreadsheets/d/1K8QhVKWSsvHTFKDHNv3ySb5bcaU9I7tczIZvIkegbw0/edit#gid=1778672780</a></p> <p><strong>What I'd like to achieve:</strong> On the Sheet 'Pharma' When B1 dropdown is set to 'Pharma', I want the table to display all data for Pharma industry.</p> <p>I.e., When B1 = Pharma, I want the function in A3 to run (=query({Sanshiro!A1:O; Suil!A1:O; Yujiro!A1:O;Josh!A1:O}, "select * where Col2 contains 'Pharma'",0))</p> <p>Is there a way to do this with just functions or do I have to use a script such as onEdit?</p> <p>e.g. something along the lines of </p> <pre><code>=if (B2 = 'Pharma', run =query({Sanshiro!A1:O; Suil!A1:O; Yujiro!A1:O;Josh!A1:O}, "select * where Col2 contains 'Pharma'",0) </code></pre> <p>Can anyone point me in the right direction?</p> <p>Thank you in advance!!</p>