Google-sheets – How to pull information from google sheets based on a date range

google sheets

I am using google sheets to collect information about patients in one of our programs. I want to be able to pull a list every week of the patients I need to follow up on. The new spread sheet needs to include all the information for the patient but only those that need to be called that week.

For example the sheet includes the information below:

Header
COLUMN A: last name
COLUMN B: first name
COLUMN C: chart number
COLUMN D: follow up date
COLUMN E: next steps
COLUMN F: next appointment

The new sheet should be able to pull information including the header onto another sheet for the date range I choose.

Is this possible?

Best Answer

Suppose you enter the date range in A1-A2, with "from" in A1 and "to" in A2. And the sheet from which the data is pulled is named "Data". Then the formula

=filter(Data!A:F, (Data!D:D>=K1) * (Data!D:D<=K2) + (row(Data!A:A)=1))

returns the header row, and the rows where the follow-up data (D) is within the specified range.

Reference: filter formula

Also, the content of "From" and "To" cells can be automatically generated. For example, Monday of the current week is

=today()-weekday(today())+2

and Friday of the current week is

=today()-weekday(today())+6