Get the FILTER Practice Workbook
Build the date dropdowns and return every sales record between two dates.
Our sample data contains sales dates, sales agents, and amounts in columns A through C. We want to return every sales record between the start date in G4 and the end date in H4.
Instead of manually filtering the source data, we’ll use Excel formulas to create a report that changes as soon as we select different dates.

We’ll build the report in columns G through I and use columns M and N to prepare the dropdown lists. Once everything works, you can move the source data and helper lists out of sight. Just make sure the formulas and Data Validation references still point to the correct locations.
Create Dynamic From and To Date Dropdowns
Here is a step-by-step guide to creating dynamic “From” and “To” Dropdown Lists for the date selection.
How the Dynamic Dropdowns Work
A dynamic dropdown uses a source list that can expand or shrink automatically. That means you don’t have to manually update the Data Validation range whenever new dates are added.
In our example, the From dropdown contains the unique sales dates. The To dropdown depends on the From selection and only offers dates that come after it.

Step 1: Prepare the Date Lists
Our sales data contains repeated dates because several agents may have made sales on the same day. We only need each date once in our dropdown.
We’ll use column M to create a sorted list of unique dates and column N to show the dates available after the user selects a start date. These helper lists will supply the options for the two dropdowns.
Step 2: Format the Dates
Select cells M2:N54 and go to Home > Number Format > Short Date.
Excel stores dates as numbers, so the results of our formulas may initially appear as serial numbers rather than recognizable dates. Applying the Short Date format fixes how those values are displayed.
We’re formatting additional cells below the current list so new results will also appear as dates. If your dataset grows beyond row 54, extend the formatting further.

Step 3: Create a Sorted List of Unique Dates
Enter this formula in cell M2:
=SORT(UNIQUE(A5:A53))The UNIQUE function removes repeated dates from A5:A53. The SORT function then arranges the remaining dates in ascending order.
The result spills down from M2, so you only need to enter the formula once. If the underlying dates change within the referenced range, the list recalculates automatically.

Want more examples? See our guide to Excel’s SORT, UNIQUE, and other dynamic array functions.
Step 4: Create the From Date Dropdown
- Select cell G4.
- Go to the Data tab -> Data Tools group -> Data Validation.

- In the Data Validation dialog, under the Settings tab, choose List from the Allow dropdown.
- In the Source field, enter:
=$M$2#
What Does the # Symbol Mean?
The # symbol is Excel’s spilled range operator. In =$M$2#, it tells Excel to use the entire list produced by the formula in M2, not just that single cell.
If the formula returns more or fewer dates, the referenced range adjusts automatically. The dollar signs keep the starting cell reference fixed.
For more examples of spilled range references, read when to use the hash sign (#) in Excel formulas.

Add an Input Message
In the Data Validation dialog, open the Input Message tab and enter a short instruction, such as “Please select a date from the list”.
When someone selects G4, Excel displays the message to explain what they should do. Click OK to finish creating the From dropdown.

Step 5: Create the Dependent To Date Dropdown
In this step, you’ll create a dynamic “to date” dropdown list in Excel. We’ll ensure the “to date” list includes only dates after the selected “from” date.
Filter the Available End Dates
In cell N2 enter this formula:
=FILTER(M2#, M2#>G4, "")
- M2#: This is the range of cells containing the data you want to filter. Here, M2# represents the dynamic range starting at cell M2 and including all the unique, sorted dates from the “from” list.
- M2#>G4: This defines the condition that each date must meet to be included in the result. In this case, M2#>G4 checks each date in the array to see if it is greater than the selected “from” date in cell G4. If a date meets this condition, it is included in the filtered list.
- “”: This specifies what to display if no dates meet the condition. Here, “” is used to display an empty cell if there are no dates after the selected “from” date.
This filters the dates in column M. It shows only dates after the “from” date in G4. It keeps the original sorting.

Connect the List to the Dropdown
- Select cell H4.
- Go to Data -> Data Tools -> Data Validation.
- In the Data Validation dialog, under Settings, choose List from Allow.
- In the Source field enter:
=$N$2#Explanation of the # Sign: The # symbol denotes the dynamic spill area, adjusting as the list updates.

The To dropdown now offers only dates later than the From date in G4. Change G4, and the available choices in H4 update automatically.
Important: If you change the From date after already selecting a To date, Excel doesn’t automatically clear the old value in H4. Select a new end date if the previous selection is no longer valid. If the From date is the last available date, the To list has no later date to offer.
For other ways to create linked lists, see our tutorial on dynamic dependent dropdown lists in Excel.

Return All Records Between Two Dates with FILTER
The next step is to lookup values from the table in columns A through C. We want to get values where the sale date is equal to or between the two selected dates.
Select the Start and End Dates
Let’s test the report using the same dates as the video:
- From date (G4): January 23, 2019
- To date (H4): January 28, 2019
We want all sales records from January 23 through January 28, including both dates.
Enter the FILTER Formula
- Select cell G7.
- Enter the formula:
=FILTER(A5:C53, (A5:A53>=G4)*(A5:A53<=H4), "No records found")
The formula returns all matching rows from A5:C53:
- A5:C53: The sales data we want to return.
- A5:A53>=G4: Include dates on or after the start date.
- A5:A53<=H4: Include dates on or before the end date.
- “No records found”: The message displayed when nothing matches.
The asterisk (*) combines the two conditions using AND logic. A record is included only when its date satisfies both tests.
Change either dropdown, and FILTER recalculates the results automatically. The matching rows spill from G7 into the adjacent cells.
Note: This formula assumes the source contains dates without times. If the values also include times, replace the second date condition with A5:A53<H4+1 to include records throughout the selected end date.
Format the Results
The report now contains the correct records. We just need to format the results:
- Select the result dates in column G and apply Short Date.
- Select the sales amounts in column I and apply Comma Style with zero decimal places.
As long as the output cells are available, the report expands or contracts to fit the number of matching records.

How FILTER Checks Both Date Conditions
Understand the AND Logic
Let’s look more closely at the two conditions inside FILTER:
(A5:A53>=G4)*(A5:A53<=H4)The first test checks whether a sales date is on or after the start date. The second checks whether it is on or before the end date.
We multiply the conditions using an asterisk (*) because both must be TRUE for a row to appear in the report. This is AND logic.
For a deeper explanation, including when to use addition (+) for OR logic, see Excel FILTER with multiple criteria.
Test the Conditions with F9
To see how Excel evaluates each condition, select G7 and click in the formula bar.
- Highlight
A5:A53>=G4inside the formula. - Press F9 to display the TRUE and FALSE results for that condition.
- Press Esc to leave formula editing without keeping the evaluated values.
- Repeat with
A5:A53<=H4.
For the first condition, TRUE means the sales date is on or after the start date. For the second, TRUE means it is on or before the end date.

Important: Use Esc after inspecting the results so you don’t accidentally replace part of the original formula with a fixed array of values.
Repeat for the second test to see the evaluations against the end date.

Where a date is less than or equal to the selected date, the evaluation produces a TRUE response; all other responses are FALSE.
How TRUE and FALSE Determine the Results
When Excel multiplies logical values, TRUE becomes 1 and FALSE becomes 0.
Only TRUE multiplied by TRUE gives 1. Every other combination gives 0.
FILTER includes the rows where the combined condition returns 1 and excludes the rows where it returns 0. That’s how a single formula can return every record that falls within our selected date range.

Make the Date-Range Report Expand Automatically
Making your data dynamic helps ensure any new records are automatically included in your analysis. Follow these steps:
Convert the Source Data into an Excel Table
So far, our formulas reference fixed ranges such as A5:C53. If we add sales below row 53, those formulas won’t reliably include the new records.
To make the source data expand automatically:
- Click anywhere in the original sales data in columns A through C.
- Press Ctrl + T.
- Confirm that the range includes the headers and that My table has headers is checked.
- Click OK.
- Go to Table Design and rename the table SalesData.
We’ll now update the formulas to use the table’s name and column references instead of fixed cell ranges.

Update the formulas to include new rows
Converting a range into an Excel Table doesn’t automatically rewrite formulas that already use fixed cell references. We need to update two formulas.
1. Update the unique date list in M2:
=SORT(UNIQUE(SalesData[Date]))This uses the Date column from our SalesData table. When a new sales date is added, it can appear in the dropdown automatically.
2. Update the report formula in G7:
=FILTER(SalesData, (SalesData[Date]>=G4)*(SalesData[Date]<=H4), "No records found")This returns all columns from SalesData for rows where the Date falls between G4 and H4, inclusive.
The formula in N2 stays the same because it already references the dynamic list in M2 using the # operator.
Now add a new sales record to the bottom of SalesData and select dates that include it. The source table expands, the dropdown lists recalculate, and the report can include the new row without editing the formulas again.
Note: The formulas above assume the table is named SalesData and its first column is named Date. Use your actual table and column names if they differ. Keep the spilled formulas outside the Excel Table.
Remove the Table Formatting
We don’t need decorative table formatting for the source data.
- Click anywhere inside the Excel Table.
- Open the Table Design tab.
- Expand the Table Styles gallery and select Clear.
This removes the table’s visual styling but keeps the Table features, including its ability to expand when new rows are added. Clearing the style is a presentation choice, not a performance optimization.

Download the Excel FILTER Practice Workbook
Try the date dropdowns and FILTER formula with the sales data from the tutorial.
Frequently Asked Questions
Which Excel versions support this FILTER date-range method?
This method works in Excel for Microsoft 365, Excel 2021, and Excel 2024. It uses FILTER, SORT, and UNIQUE, which are not available in Excel 2019 or earlier perpetual versions.
Are the start and end dates both included?
Yes. The conditions use greater than or equal to for the start date and less than or equal to for the end date. If your source dates include times, use a condition earlier than the end date plus one day to include the full final day.
Why can’t I choose the same start and end date?
The To dropdown uses a strict greater-than comparison, so it only lists dates later than the selected From date. To allow the same day, change that test to greater than or equal to.
Does changing the From date reset the selected To date?
No. The available To choices update, but Excel does not automatically clear an end date that was already selected. If you change the From date, check H4 and select another To date if necessary.
Why aren’t newly added sales records showing in the results?
The original formulas use fixed ranges ending at row 53. Convert the source into an Excel Table and update the formulas to use structured references, such as SalesData[Date], so added rows are included. Use your actual table and column names.
How do I fix a #SPILL! error in the FILTER results?
A #SPILL! error means Excel cannot place the full result in the worksheet. Clear any values or merged cells blocking the output, and keep the FILTER formula outside an Excel Table.
Leila Gharani
Founder of XelPlus and ten-time Microsoft MVP. Leila helps over 500,000 professionals master Excel, Power BI, and data automation through practical, real-world training.








