# COUNTIF that contains a specific date ignoring the rest

#### leokiwi

##### New Member
Hello guys,

I'm trying to create a formula that counts the cells that contains a specific date given by another cell for example:

 A B 1 Dates 2 01-Jun 03:30 3 01-Jun 04:00 4 02-Jun 01:15 5 03-Jun 09:30 6 7 Calculations: 8 01-Jun ???

<tbody>
</tbody>

The idea is that B8 should give the amount of dates with the criteria on A8 using the range A2:A5

What I'm using at the moment is COUNTIF(A2:A5,A8&"**) that's obviously not working at the moment, any ideas?

Cheers,

Leo

### Excel Facts

To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
One way:

Excel 2010
AB
1Dates
26/1/2012 3:30
36/1/2012 4:00
46/2/2012 1:15
56/3/2012 9:30
6
7Calculations:
81-Jun2
Sheet4
Cell Formulas
RangeFormula
B8=SUMPRODUCT(--(MONTH(A2:A5)=MONTH(A8)),--(DAY(A2:A5)=DAY(A8)))

It works perfectly!!! thank you!!!

You are welcome.

Replies
3
Views
620
Replies
5
Views
4K
Replies
6
Views
330
Replies
0
Views
345
Replies
3
Views
833

1,203,060
Messages
6,053,303
Members
444,650
Latest member
bookendinSA

### 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