# Help with COUNTIF statement

#### ronni_e

##### New Member
I have data that contains data with dates. Dates are in the format of 12/1/2004 etc. I want to make a countif statement to tell me many values fall in a particular month.. So here is what I am trying

=COUNTIF(data!K5:K1480,12/1/2004:12/31/2004)

Which doesnt work.. It will tell me what is on 12/1/2004 if I remove the :12/31/2004..

What is the method to specify a range in the criteria?

data!K5:K1480 is the page and column that I want to find the values of.

### Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Welcome to the board!

Try =COUNTIF(data!K5:K1480, "<1/1/2005")-COUNTIF(data!K5:K1480,"<12/1/2004")

I will give that a try.. Didnt think of doing it that way.. Basically I need to know how many values fall in each month.. so for say January of 2004 id do something like >12/31/2004 and <2/1/2004

Thanks.. I dont see why that wont work

ronni_e said:
I will give that a try.. Didnt think of doing it that way.. Basically I need to know how many values fall in each month.. so for say January of 2004 id do something like >12/31/2004 and <2/1/2004

Thanks.. I dont see why that wont work

You could use,

=SUMPRODUCT(--(YEAR(DateRange)=2004),--(MONTH(DateRange)=1))

thanks... all worked great.

Replies
7
Views
211
Replies
1
Views
156
Replies
2
Views
156
Replies
1
Views
272
Replies
1
Views
439

1,196,480
Messages
6,015,450
Members
441,896
Latest member
clomah

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back