How to count dates that are within a specific month while ignoring blank cells?

Int3rn

New Member
Joined
Apr 1, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I am using the method described here: How to Countif by date/month/year and date range in Excel?, but I am open to changing the formula altogether if needed.

My specific formula is =SUMPRODUCT(1*(MONTH(Submissions!W:W)=1)) for January, =SUMPRODUCT(1*(MONTH(Submissions!W:W)=2)) for February, and so on.

These formulas work only if the range is W2:W10 or whatever range doesn't contain blank cells. How do I get the formula with W:W to ignore the blank cells and not return a #VALUE! error or count blank cells as January?

Thanks for your help!
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,557
Office Version
  1. 365
Platform
  1. Windows
Hi & welcome to MrExcel.
How about
Excel Formula:
=SUMPRODUCT((MONTH(Submissions!W:W)=1)*(Submissions!W:W<>""))
BUT you should never use use entire columns in array functions. It can bring your workbook to a grinding halt.
 

Int3rn

New Member
Joined
Apr 1, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi & welcome to MrExcel.
How about
Excel Formula:
=SUMPRODUCT((MONTH(Submissions!W:W)=1)*(Submissions!W:W<>""))
BUT you should never use use entire columns in array functions. It can bring your workbook to a grinding halt.
Thank you! This worked perfectly. I had no idea about using whole columns in array functions, thanks for the tip! I won't ever need to go past 200 entries, so I made the range W2:W201 and it works great.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,557
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,129,556
Messages
5,637,035
Members
416,954
Latest member
Gohar hussain

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
Top