ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Count cells based on date range in another column (https://www.excelbanter.com/new-users-excel/24995-count-cells-based-date-range-another-column.html)

[email protected]

Count cells based on date range in another column
 
Could someone please suggest how to use a worksheet function to count
the number of non-empty cells in one column when the value in another
(date) column is in a particular date range? The first column happens
to be dates as well, but the formula would ideally work regardless of
the counted column's data type.

e.g.

Given data such as:
Column 1 Column 2
--------- --------
23-Oct-03 2-Jan-04
12-Dec-03
1-Jan-05 14-Feb-05
31-Oct-02 12-Dec-03
1-Jan-05 14-Feb-05
31-Oct-02 12-Dec-03

How do I count the non-empty cells in Column 1 when Column 2 contains a
date in the year 2003?

Thanks,

Terry


Peo Sjoblom

=SUMPRODUCT(--(YEAR(C2:C10)=2003),--(B2:B10<""))

where C2:C10 is column 2 and B2:B10 column 1

Regards,

Peo Sjoblom

" wrote:

Could someone please suggest how to use a worksheet function to count
the number of non-empty cells in one column when the value in another
(date) column is in a particular date range? The first column happens
to be dates as well, but the formula would ideally work regardless of
the counted column's data type.

e.g.

Given data such as:
Column 1 Column 2
--------- --------
23-Oct-03 2-Jan-04
12-Dec-03
1-Jan-05 14-Feb-05
31-Oct-02 12-Dec-03
1-Jan-05 14-Feb-05
31-Oct-02 12-Dec-03

How do I count the non-empty cells in Column 1 when Column 2 contains a
date in the year 2003?

Thanks,

Terry




All times are GMT +1. The time now is 04:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com