samedi 24 avril 2021

Using IF in SELECT statement of Google Sheets Query

In order to provide relevant data to an accounting person for him to work further in the Bill Booking stage from a master sheet that I manage in Google Sheets, the query function needs to satisfy either of the two conditions.

The master sheet is here https://docs.google.com/spreadsheets/d/1pY53-XaGnUQ3BPmLh90mLSqIwSo7S2_QOPbD6JBQHOA/edit#gid=0

Two conditions for an accounting person to see what he needs to work on is (if either of the mentioned two conditions is fulfilled, the data needs to be shown)

  1. If Col8 = "Yes" and Col14 = "Done"
  2. If Col8 = "No" and Col11 = "Done"

For this, I have tried the following

Ifna(QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1pY53-XaGnUQ3BPmLh90mLSqIwSo7S2_QOPbD6JBQHOA/edit#gid=0","Master!A3:N")," Select Col1, Col2, Col3, Col4, Col5, Col7 "&IF(OR(AND(COL8 = "Yes", COL14 = "Done"), AND(COL8 = "No", COL11 = "Done")))&" "))

Currently, this is not showing me any data and without any error. However, it should show him 3 data to work on.

Kindly help me with this.

Aucun commentaire:

Enregistrer un commentaire