Consider the following,
I have three columns,
date, sales rep, revenue,
Date, Sales Rep, Revenue,
1/1/18 Jon £250
1/1/18 Evie £350
1/1/18 Muhammad £220
Now, to query this data I can do the following:
IF(a2="","", QUERY(B2:C4, "Select * Where A = '"&A2&"')
now what I want to know is how one would nest multiple queries into one cell if one had multiple drop downs for the above. One selecting sales rep and one for date. So if one Selected a Sales rep & a date, they would get the specific date and sales rep but if one selected JUST a sales rep they would get all their sales regardless of date, and the reverse if possible.
I've tried an OR statement
IF(OR(a2="","", QUERY(B2:C4, "Select * Where A = '"&A2&"'), IF(a3="","", QUERY(B2:C4, "Select * Where b = '"&A3&"'))) but this didn't work.
I've created some dummy data and an open sheet for your convenience.
https://docs.google.com/spreadsheets/d/15nlBPM9u3g0XNE3xbBgSZJxyHz2JjP9io1LfqGgX4CI/edit?usp=sharing
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…