countif for current year when date is in format mm/dd/yyyy

adunlap13

New Member
Joined
Feb 2, 2016
Messages
7
Hi,

I am trying to count the number of times the current year is in a single column for certain people. The below is what I have so far but I keep getting 0 returned.

=COUNTIFS($H25:$H500,"=WP",$J25:$J500,"="&YEAR(NOW()))

Thank you in advance for the help!
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Try changing "="&YEAR(NOW())) to:

">="&DATE(YEAR(NOW()),1,1

this says that countif the date is larger than jan1, 2016
 
Upvote 0
That will work if there are no dates in 2017. If there's a possibility that you will have dates in future years then:

=SUMPRODUCT(($H25:$H500="WP")*(YEAR($J25:$J500)=YEAR(NOW())))

You can change YEAR(NOW()) to a hard-coded year if necessary

=SUMPRODUCT(($H25:$H500="WP")*(YEAR($J25:$J500)=2016))

WBD

Note: Cross-posted with Aladin
 
Last edited:
Upvote 0
Try...

=COUNTIFS($H25:$H500,"=WP",$J25:$J500,">="&DATE(YEAR(TODAY()),1,1),$J25:$J500,"<="&TODAY())

That worked perfectly, thanks a lot!

I did have to add $J25:$J500 before the final "<="&TODAY(). Just wanted to put that in there if any other people glanced at this.
 
Upvote 0

Forum statistics

Threads
1,215,478
Messages
6,125,040
Members
449,205
Latest member
Eggy66

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