4.2 C
London
Friday, December 20, 2024
HomeSoftware TutorialsGoogle SheetsHow to Use COUNTIFS with a Date Range in Google Sheets

How to Use COUNTIFS with a Date Range in Google Sheets

Related stories

Learn About Opening an Automobile Repair Shop in India

Starting a car repair shop is quite a good...

Unlocking the Power: Embracing the Benefits of Tax-Free Investing

  Unlocking the Power: Embracing the Benefits of Tax-Free Investing For...

Income Splitting in Canada for 2023

  Income Splitting in Canada for 2023 The federal government’s expanded...

Can I Deduct Home Office Expenses on my Tax Return 2023?

Can I Deduct Home Office Expenses on my Tax...

Canadian Tax – Personal Tax Deadline 2022

  Canadian Tax – Personal Tax Deadline 2022 Resources and Tools...

You can use the following syntax to count the number of cell values that fall in a date range in Google Sheets:

=COUNTIFS(A2:A11,">="&D2, A2:A11,""&E2)

This formula counts the number of cells in the range A2:A11 where the start date is equal to or greater than the date in cell D2 and the end date is equal to or less than the date in cell E2.

The following example shows how to use this syntax in practice.

Example: Use COUNTIFS with Date Range in Google Sheets

Suppose we have the following dataset in Google Sheets that shows the number of products sold on various days:

We can define a start and end date in cells D2 and E2 respectively, then use the following formula to count how many dates fall within the start and end date:

=COUNTIFS(A2:A11,">="&D2, A2:A11,""&E2)

The following screenshot shows how to use this formula in practice:

Google Sheets COUNTIFS date range

We can see that 3 days fall in between the range 1/10/2021 and 1/15/2021.

We can manually verify that the following three dates in column A fall in this range:

  • 1/12/2021
  • 1/14/2021
  • 1/15/2021

If we change either the start or end date, the formula will automatically update to count the cells within the new date range.

For example, suppose we change the start date to 1/1/2021:

We can see that 8 days fall between the range 1/1/2021 and 1/15/2021.

Additional Resources

The following tutorials provide additional information on how to work with dates in Google Sheets:

How to AutoFill Dates in Google Sheets
How to Add & Subtract Days in Google Sheets
How to Calculate the Difference Between Two Dates in Google Sheets

Subscribe

- Never miss a story with notifications

- Gain full access to our premium content

- Browse free from up to 5 devices at once

Latest stories