Forum Discussion
Calculate dates and counts based on entered date
- Anonymous6 years ago
I searched the forum and found another posting that answers my question:
Thank you everyone!
The COUNTIFS function is built to count cells that meet multiple criteria. In this case, we need to provide two criteria: one criterion for the earlier date and one for the later date. We supply the named range dates (C5: C11) for both criteria.
To construct each date, we use the DATE function:
DATE(E5,1,1) // build first day of year
DATE(E5,12,31) // build last day of year
The DATE function makes it easy to build dates based on year, month, and day arguments that are either hard-coded or supplied as cell references. In the example, month and day are hard-coded, and we get a year from column E.
Note: the operators ">=" and "<=" must be entered as text and surrounded by double-quotes. This means we must use concatenation (&) to join each operator to each date.