Why didn't my original CountIF formula work?
I am trying to count the number of projects that began since Jan 1, 2024. I typed in the formula =COUNTIF([Start Date]:[Start Date], ">= Jan 1, 2024"). Basically I wanted to count the number of projects with a start date that were equal to Jan 1, 2024 or greater. However that formula gave the blatantly incorrect answer.
Using Smartsheet AI they gave me this formula =COUNTIF([Start Date]:[Start Date], >=DATE(2024, 1, 1)) which gave the correct answer.
But I still have no clue why the original formula I wrote didn't work. Can someone help me out? Thanks!
Answers
-
The original formula is comparing a date to text, "Jan 1, 2024". Date(2024,1,1) works because it is a date.
-
@dojones ok makes sense, how come though it still provided an answer? The column I was using was a Date field column, yet the original formula still counted '2,' curious as to why that happened?
Thanks for answering!
-
@RL5500
If there is something in your column that begins with K,L,M,N, … it will count that. Maybe a few fields are entered as a word. Change field to Date Only and see if it changes to 0 for count.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.2K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 141 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!