How to use query to filter data based on certain conditions in google sheet

weizer

enter image description here

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

Mike Steelson

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.

edited at
0

Comments

0 comments
Login to comment

Related

How to use where query in Google Spreadsheet with filter multiple conditions

Query to filter data based conditions in child table

addEditor and removeEditor on certain conditions for google sheet

SQL to filter the data from inner query based on 2 conditions

How to build Linq query dynamically based on certain conditions

How to use restricted data validation in Google sheet

How To Filter Rows Based On A List From Another Sheet? (Google Sheets)

How to record the data every day to another google sheet at a certain time?

How to use QUERY and IMPORTRANGE function together to extract and transpose data in google sheet?

How to use sql query to find percentage on the basis of certain conditions?

Filter rows based on certain conditions in pandas dataframe

Filter rows of a dataframe based on certain conditions in pandas

Retrieving Selective rows in Google Sheet based on conditions

Using query in google sheet to call certain rows

Google sheet - how to filter the data with custom date range

DynamoDB: How to use a query filter to check for conditions in a MAP

DynamoDB: How to use a query filter to check for conditions in a MAP?

How to automate the code to fetch data based on 2 filter conditions in python?

How to filter a data.table based on an uncertain number of conditions?

How to filter data based on two conditions in rows in Tableau

How to filter out rows on one sheet based on cell values listed in another sheet in google app scripts GAS

How to Copy data from One Google Sheet to another Sheet in the Same file Using Sheet Name as Criteria and find the sheet base on filter criteria

How to use jQuery to filter divs based on certain classes

How to use Column Value as header in Query in google sheet

Query with Google sheet formula using Filter

Use Regex to exclude numbers based on certain conditions

How to consolidate data in google sheet using query function

How to import data with query function along with OR Condition in google sheet

Query to filter records based on specific conditions