Hi everyone,
I have 3 conditions from column B to column D. T
= to the condition fulfilled in that particular date and F
otherwise. All the 3 conditions have their own T
and F
in each date.
What I want to achieve is:
When I select On
for condition 1, Off
for condition 2 and On
for condition 3, the QUERY
function able to ignore the Condition 2 and give me the rows of the date where Condition 1 = T
and Condition 3 = T
. So basically if the Condition 2 is Off
, then the query function will just looking at Condition 1 and 3 and extract the date where Condition 1
and Condition 3
is equal to T
.
The data in column F is the expected output based on the On Off
condition in B2:B4
. May I know is there any way that I can achieve this automation? Any help will be greatly appreciated!
This is my sheet:
https://docs.google.com/spreadsheets/d/1zOB2rrysOQ7V6_Pa-caQN94Y-gFI_JT2gJ9Hf6tZQi8/edit#gid=0
Try, in C2 =if(B2="On","B='T'",)
then C3 =if(B3="On","C='T'",)
then C4 =if(B4="On","D='T'",) then in
C5
=textjoin(" and ",true,C2:C4)
then
=QUERY(A8:D16,"Select A " & if(C5="",,"where "&C5&" "),1)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments