Calculation Issues

How to Count Dates by Year Across Multiple Excel Worksheets

Emma BrownEmma Brown Nov 10, 2026 869 views

Question details

The user wants to count the number of dates that fall within a specific year across multiple Excel worksheets without writing separate COUNTIFS formulas for each sheet.

How to Count Dates by Year Across Multiple Excel Worksheets
Product
Excel
Device & OS
not provided
Scenario
Aggregating and counting dates within a specific year spanning across multiple different worksheets.
Observed behavior
Combining data ranges from multiple contiguous sheets into a single array to easily evaluate and count dates within specific start and end boundaries.
Before you start

Ensure that the worksheets you want to include in the count are grouped contiguously in your workbook, and that your target date ranges are located in the exact same columns across all these sheets.

Solution 1Recommended

Use VSTACK and LET to Count Dates Across Worksheets

Combine your sheet ranges using a 3-D reference inside the VSTACK function, then filter and count the target year dynamically.

Instead of combining multiple COUNTIFS formulas, you can use the VSTACK function with a 3-D reference to stack the ranges from consecutive sheets into a single array. The LET function is then used to name this array, and FILTER helps isolate the dates belonging to a specific year before counting them.

1
Identify the Sheet Boundaries and Range

Determine the first and last worksheet names you want to include (e.g., 'Exec' and 'Int Audit') and ensure the dates are located in the same cell range, such as I2:I50000.

2
Combine Ranges with VSTACK and TOCOL

Use TOCOL(VSTACK('Exec:Int Audit'!I2:I50000),1) to stack the date columns from all included sheets and safely ignore any empty cells within those ranges.

3
Apply FILTER for the Target Year

Filter the combined date array using the DATE function. For example, to count dates falling in 2022, configure your logical test as (dates>DATE(2021,12,31))*(dates<DATE(2023,1,1)).

4
Wrap the Logic with LET and COUNTA

Combine the elements into your final formula: =LET(dates,TOCOL(VSTACK('Exec:Int Audit'!I2:I50000),1),COUNTA(FILTER(dates,(dates>DATE(2021,12,31))*(dates<DATE(2023,1,1))))). Press Enter to generate the total count.

Use VSTACK and LET to Count Dates Across Worksheets
Formula Compatibility: Functions like VSTACK, LET, and TOCOL are dynamic array functions available in Microsoft 365 and newer versions of Excel. Ensure your spreadsheet software is updated to fully support these formulas.
Advanced Array Formulas Made Easy

Calculate Data Across Multiple Sheets with WPS Spreadsheet

You can seamlessly aggregate and calculate data spanning multiple worksheets using advanced array functions natively in WPS Spreadsheet. It offers a fast, lightweight, and highly compatible environment for all your complex data analysis needs.

  1. 1. Open Your Workbook in WPS Spreadsheet: Launch WPS Office and open your .xlsx file containing the multiple worksheets you need to analyze.
  2. 2. Select the Destination Cell: Click on the cell where you want the final date count to be displayed.
  3. 3. Input the Formula: Type or paste your combined =LET(...) and VSTACK formula just as you would in Excel to combine and filter the cross-sheet data.
  4. 4. Calculate the Result: Press Enter to execute the cross-sheet array calculation instantly and save your document.
Full compatibility with Microsoft Excel (.xlsx) formats and modern dynamic array functions.Lightweight application that smoothly processes large datasets and cross-sheet 3-D references.Free to download, featuring an intuitive tabbed interface to enhance your productivity.
QA img-9

Frequently Asked Questions

Why is my VSTACK 3-D reference returning a #NAME? error?

This error typically occurs if you are using an older version of Excel (like Excel 2016 or 2019) that does not support modern dynamic array functions like VSTACK or LET. Upgrading to a newer version or using a compatible software like WPS Office will resolve this issue.

What does the '1' mean in the TOCOL function of this formula?

In the function TOCOL(array, 1), the '1' parameter instructs the program to ignore all blank cells. This is highly useful when stacking large ranges across multiple sheets, as some sheets might contain fewer rows of data than others, preventing blank rows from skewing your array processing.

Can I use COUNTIFS across multiple sheets without using VSTACK?

Yes, but it requires wrapping COUNTIFS inside a SUMPRODUCT function along with an INDIRECT reference pointing to a named range of all your worksheet names. While effective in older versions, this method is generally more complex to maintain than using a 3-D VSTACK array.