mercredi 6 octobre 2021

Apply an IF logic within a QUERY

Thanks in advance. I have an issue with pulling data using a QUERY within google sheets. I need to pull data from two different columns depending on which column has a later date.

I have been able to pull through the correct values within an IF formula:

""=ARRAYFORMULA(IF(Database!P12:P>Database!AH12:AH,Database!P12:P,Database!AH12:AH))""

However, I need to select specific rows of data based on this QUERY:

""=QUERY(Database!C12:AM,"SELECT P WHERE AC CONTAINS 'PRICE | Time-limited save' AND AG = date '"&text(Database!N2,"yyyy-MM-dd")&"' and lower(Y) contains 'approved'")""

I need to select data from column P unless column AH has a later date.

Thanks

Aucun commentaire:

Enregistrer un commentaire