COUNTIFS Formula with NOT function
I'm trying to count the number of cells filled with a date within a column, except for rows that have status as "On Hold". The formulas I've tried are:
=COUNTIFS({Charter Date}, AND(IFERROR(MONTH(@cell, 0) = 1, IFERROR(YEAR(@cell), 0) = 2022), {Approved Gate}, NOT(@cell = "On Hold")))
Output: Invalid Data Type error.
=COUNTIFS({Charter Date}, AND(IFERROR(MONTH(@cell, 0) = 1, IFERROR(YEAR(@cell), 0) = 2022), {Approved Gate}, <>"On Hold"))
Output: Invalid Data Type error.
Any thoughts? Appreciate the help.
Best Answer
-
That's probably because some of the rows may have no date (aka blank cell) in your {Charter Date} range. Additionally the arguments to the MONTH function are incorrect.
Try this:
=COUNTIFS({Charter Date}, NOT(ISBLANK(@cell)), {Charter Date}, AND(MONTH(@cell)=1, YEAR(@cell)=2022), {Approved Gate}, <>"On Hold")
Answers
-
That's probably because some of the rows may have no date (aka blank cell) in your {Charter Date} range. Additionally the arguments to the MONTH function are incorrect.
Try this:
=COUNTIFS({Charter Date}, NOT(ISBLANK(@cell)), {Charter Date}, AND(MONTH(@cell)=1, YEAR(@cell)=2022), {Approved Gate}, <>"On Hold")
-
Thank you Sameer! This works great - just to clarify, does the Charter Date range need to be referenced twice separately or could the NOT, MONTH and YEAR functions be combined into one Charter Date range reference? Thanks again.
-
Good thinking, and did you try that? My take is it will not work. The blank rows need to be eliminated before those functions are processed.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 65.3K Get Help
- 445 Global Discussions
- 144 Industry Talk
- 477 Announcements
- 5K Ideas & Feature Requests
- 85 Brandfolder
- 151 Just for fun
- 72 Community Job Board
- 488 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 302 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!