Search code examples
google-sheetsgoogle-sheets-formulaspreadsheet

How to Use Query function to list consumer which purchased 5 days ago


I am try to write a Query function to automatically update consumer which purchased 5 day ago.

This result should alwasy be updated according to Today's date.

(Please use Query function to achieve this results, Because I need this Query method to apply into a more complex formula.)

Thank you so much.

https://docs.google.com/spreadsheets/d/1Y2rB910btqX-THHgNEylXuSN-aeKQv__siScoBTLZv8/edit?usp=sharing


Solution

  • In G2 I entered

    =query(A2:B, "Where A <= date '"&TEXT(TODAY()-5, "yyyy-mm-dd")&"'", 0)
    

    This should output all purchases done before 5 days ago as that seems to be the result you expect.

    See if that works for you?