“How can I use Excel to count data by year?” 2

“How can I use Excel to count data by year?”

Excel is a powerful tool that allows users to easily organize and analyze data. One useful function of Excel is the ability to count data by year. This feature can be utilized by utilizing the COUNTIFS function, which allows the user to specify a range of criteria to be counted. By inputting the year as one of the criteria, Excel will count and display the number of entries that fall within that specific year. This feature is particularly useful for tracking and analyzing data trends over time, making it an essential tool for data analysis and decision-making.

Count by Year in Excel


You can use the following formula to count the number of occurrences by year in an Excel spreadsheet:

=SUMPRODUCT(1*(YEAR(A1:A10)=2020))

This particular formula counts the number of dates in the range A1:A10 that occur in the year 2020.

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

Example: Count by Year in Excel

Suppose we have the following dataset that shows the sales of some product on various dates:

Now suppose we’d like to count the number of dates by year.

To generate a list of unique years, we can use the following formula:

=SORT(UNIQUE(YEAR(A2:A15)))

We’ll type this formula into cell D2:

Next, we can use the following formula to count the number of dates by year:

=SUMPRODUCT(1*(YEAR($A$2:$A$15)=D2))

We’ll type this formula into cell E2, then copy and paste it into each remaining cell in column E:

Excel count by year

From the output we can see:

  • The year 2018 occurred 2 times.
  • The year 2019 occurred 3 times.
  • The year 2020 occurred 2 times.

And so on.

Additional Resources

The following tutorials explain how to perform other common tasks in Excel:

Cite this article

stats writer (2024). “How can I use Excel to count data by year?”. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-use-excel-to-count-data-by-year/

stats writer. "“How can I use Excel to count data by year?”." PSYCHOLOGICAL SCALES, 28 Jun. 2024, https://scales.arabpsychology.com/stats/how-can-i-use-excel-to-count-data-by-year/.

stats writer. "“How can I use Excel to count data by year?”." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-use-excel-to-count-data-by-year/.

stats writer (2024) '“How can I use Excel to count data by year?”', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-use-excel-to-count-data-by-year/.

[1] stats writer, "“How can I use Excel to count data by year?”," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.

stats writer. “How can I use Excel to count data by year?”. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.

Download Post (.PDF)
Slide Up
x
PDF
Scroll to Top