COUNTIF Function and Blank Date Cells

Atkey

New Member
Joined
Mar 13, 2024
Messages
8
Office Version
  1. 365
Platform
  1. Windows
I am attempting to generate a table that would show the number of dates in a column that are equal to or less that today' date. Some cells are blank and the formula is counting these blank cells. How would I get my formula to just count dates in the required range and ignore the blanks?

I am using =COUNTIF(M2,"<="TODAY())

Thanks in advance!
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Hi & welcome to MrExcel.
Try
Excel Formula:
=countifs(m:m,"<="&today(),m:m,"<>")
 
Upvote 0
Fluff,

Thanks, unfortunately that didn't work. The formula is still counting blank cells. The cells are formatted as dates would a blank be seen as a date less then today?
 
Upvote 0
Are the values in those cells hard-coded, or the result of formulas?
If hard-coded, can you identify one of these supposedly "blank cells", and see what the length is?

I.e. if it was cell M2, enter this formula in any blank cell and tell us what it returns:
Excel Formula:
=LEN(M2)
 
Upvote 0
In that case can you post some sample data.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
The data in the cells come from a different sheet. the LEN function delivers a result of 1.
 
Upvote 0
The data in the cells come from a different sheet. the LEN function delivers a result of 1.
That means it is not truly blank. There is "something" in there, whether it be a space, special character, or something else.

The CODE should identify exactly what is in there, i.e.
Excel Formula:
=CODE(M2)

What does that return?
 
Upvote 0
It cells are showing the source formula =Master[Leave Date]
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,195
Members
453,021
Latest member
pingpong7117

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