COUNTIFS return 0

datawiz

New Member
Joined
Feb 14, 2014
Messages
6
Hi,

I have an Excel sheet where I have unique numbers on col A, dates on col B, and numbers ($) on col D.

I want to count where month is june (col B) and <=$100 on col D.

I am using =COUNTIFS($B$3:$B$300, (MONTH($B$3:$B$300)=6), $D$3:$D$300, "<=100") but the formula returns 0 where I must have some number, I filtered and actually counted. Where am I doing wrong?

Thank you in advance!
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
You can't use MONTH function like that in COUNTIFS, try using SUMPRODUCT, e.g.

=SUMPRODUCT((MONTH($B$3:$B$300)=6)*($D$3:$D$300<=100))
 
Upvote 0
One more quick question, if there are breaks in my date columns (empty cells), would it still work?
 
Upvote 0
Excel regards empty cells as January dates, MONTH(cell)=1, so it's not a problem to have blanks as long as you aren't counting January dates - when you count those you need an extra check to make sure they aren't blank, i.e.

=SUMPRODUCT((MONTH($B$3:$B$300)=1)*($D$3:$D$300<=100)*($B$3:$B$300<>""))
 
Upvote 0
Thank you once again! I pay attention to January dates, yet when I copy/paste my column with its values, I have no problem and it calculates perfectly. However, with the blanks in the original column I get #VALUE error; do you have any idea why?
 
Upvote 0

Forum statistics

Threads
1,215,343
Messages
6,124,400
Members
449,156
Latest member
LSchleppi

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