简体   繁体   中英

how to query with a date referencing a range of dates in google sheets

here is the link>

https://docs.google.com/a/auind.com/spreadsheets/d/1ZnV0uNwM-uS_kK3CQwx-EGy9c9PAK4enCzSIv0bCva0/edit

i want rows from sheet one to transfer over to sheet two but only show me the rows with column L with a value between 1-150000 and with Col C with a date between d3 and d4. d3 and d4 change everyday so thus the data being imported over would change accordingly. te formula should go into a6 on sheet two. since rows 1-5 on both sheets are frozen headers.

I would use FILTER function in this special case. Try this for the A6 cell on sheet two:

=FILTER('Foreclosure Leads'!A6:L,'Foreclosure Leads'!L6:L>=1,'Foreclosure Leads'!L6:L<=150000,'Foreclosure Leads'!C6:C>='Foreclosure Leads'!D3,'Foreclosure Leads'!C6:C<='Foreclosure Leads'!D4)

This does the following:

  1. 'Foreclosure Leads'!A6:L - First it tells that we are investigating the rows from 'Foreclosure Leads' worksheet. First row is the 6th, the last is undefined. The columbs from A to L will be copied.

  2. Then there are the conditions:

    • 'Foreclosure Leads'!L6:L>=1 - The value in the L cell should be greater or equal to 1
    • 'Foreclosure Leads'!L6:L<=150000 - The value in the L cell should be less or equal to 150000
    • 'Foreclosure Leads'!C6:C>='Foreclosure Leads'!D3 - The value in the C cell should be greater or equal to the date in the D3 cell (which is today)
    • 'Foreclosure Leads'!C6:C<='Foreclosure Leads'!D4 - The value in the C cell should be less or equal to the date in the D4 cell

Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM