Countif formula help

Siyanna

Well-known Member
Joined
Nov 7, 2011
Messages
1,146
Hi Guys,

Please advise what i am doing wrong
I need to count how many dates are = to date in 01
the range compared is Col C. In Col C i have just dates i.e 15/05/2012
In O1 i have date + time however i just need the date.

I also need to compare how many dates are between 2 and 5 days and also > than 5 days.

I have tried this formula for the = part

=COUNTIF(C:C,date(year(O1,month(O1),day(O1))))

Many Thanks
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
You're missing a parenthesis DATE(YEAR(O1),MONTH(O1),DAY(O1))

You could just use INT(O1) instead, to remove the time element from the date

Answer to the "duration" question depends on (a) what version of Excel you're using, and (b) what you mean by "how many dates are between 2 and 5 days and also > than 5 days". I assume you mean a difference of these amounts from the value in O1


In Excel 07 or later you could use something like =COUNTIFS(C:C,">"&INT(O1)-5,C:C,"<"&INT(O1)-2)

In Excel 03 or earlier you'll need a different formula, let me know
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,185
Members
449,071
Latest member
cdnMech

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top