How do I count the number of records within a date range? New issu

G

Guest

My employer provides a database that I converted to excel with the following
values for dates... example... 01/01/2006.

I need some help to build a formula to count the namber of cells that fall
within a range of dates... for example 01/01/1955 to 12/31/1977. How do I do
this? I've tried lots of ideas... nothing seems to work for me.
 
R

Roger Govier

Hi Larry

There are many ways to achieve this.
It is probably easiest to put the date ranges in cells e.g. enter in D1
01/01/1955 and in E1 12/31/1977

Then with your range of dates being in column A
=COUNTIF(A:A,">="&D1)-COUNTIF(A:A,">"&E1)
This counts all the cells which have dates greater tna or equal to the
first date, and subtracts the number that are greater than the last date

Alternatively
=SUMPRODUCT(($A$1:$A$1000>=D1)*($A$1:$A$1000<=E1))
Note that you cannot use whole columns ranges with Sumproduct, just set
the range long enough to cover your set of data.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top