Countifs formula to count a value within a date range?
Our company has ongoing surveys and the raw data is organized by different dates (dates the survey was complete). We want to only count the cells for a particular date range in our calculations sheet to give us the survey results for that time frame.
For example: I only want smartsheet to look at the surveys completed between 1/1/2021 and 12/31/2021 and within that, only look at the values that equal "5" for a particular question (column).
Would this be a countifs formula? If so, how would it be structured? The goal is some sort of automation as more surveys are completed.
Answers
-
You have a few different options. If you want specific dates:
=COUNTIFS([Date Column]:[Date Column], AND(@cell>= DATE(2021, 01, 01), @cell<= DATE(2021,12,31)), Question:Question, @cell = "5")
If you just want a year:
=COUNTIFS([Date Column]:[Date Column], IFERROR(YEAR(@cell), 0) = 2021, Question:Question, @cell = "5")
If you want a specific year and month (January in this example):
=COUNTIFS([Date Column]:[Date Column], AND(IFERROR(YEAR(@cell), 0) = 2021, IFERROR(MONTH(@cell), 0) = 1), Question:Question, @cell = "5")
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 439 Global Discussions
- 138 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 488 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!