MrExcel Publishing
Your One Stop for Excel Tips & Solutions

COUNTIF using dates


Posted by Len on November 21, 2001 12:50 AM

I need to count the number of transactions completed during calender years.

I've tried the following but get an "invalid" message - any ideas on where I'm going wrong?

=COUNTIF(AND(D14>31-12-1988,D14<01-01-1990),0)

Is there an easier way of setting it up so that I can alter the calender years with less hassle?

Cheers


Posted by Aladin Akyurek on November 21, 2001 2:23 AM

Lets say that houses D2:D15 "date completed",
E1 the first date condition, and F1the second date condition with proviso that F1>E1.

You can count completed transactions with:

=COUNTIF(D1:D14,">"&E1)-COUNTIF(D2:D15,">="&F1)

Note that the count is done according to a exclusive between condition.

Aladin

============