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

自闭症网瘾萝莉.ら 提交于 2019-12-12 00:51:01

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/22207337/how-to-query-with-a-date-referencing-a-range-of-dates-in-google-sheets

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!