CountIF one of multiple criteria are met within the current year.
Good Afternoon. I'm trying to get a count if a specific event is documented to occur within any row in specific columns. This is where I'm at, although unsuccessfully....
=COUNTIFS({Range 1}, "Value1", {Range 2}, "Value 1", {Date Range 1}, AND(IFERROR(YEAR(@cell), 0) = YEAR(TODAY())))))
I need the sheet to count if "Value 1" appears in either "Range 1" or "Range 2" columns. Not that it must appear in both. I also need it to count of the date the value was generated was within the current year. I know the IFERROR function works, I just don't think I have the whole thing set up correctly. Thanks in advance!
Best Answer
-
Kelly, thank you very much! That appears to have solved the issue.
Answers
-
Try this one...
= COUNTIFS(OR({Range 1} = "Value 1", {Range 2} = "Value 1"), {Date Range 1},IFERRIOR(YEAR(@cell),0)=YEAR(TODAY()))
Now one thing is this is what will work if Range 1, Range 2, and Date Range 1 are cross sheet references if not then those references in the formula will be slightly different
-
I'm getting an "Invalid Operation" Error on this format.
-
Hey @Kris V. Le
Because the 'OR' is occurring between multiple ranges and not choices within a single range you need to add the COUNTIFS together.
= COUNTIFS({Range 1},"Value 1", {Date Range 1},IFERROR(YEAR(@cell),0)=YEAR(TODAY())) + COUNTIFS({Range 2},"Value 1", {Date Range 1},IFERROR(YEAR(@cell),0)=YEAR(TODAY()))
Does this work for you?
-
Kelly, thank you very much! That appears to have solved the issue.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.5K Get Help
- 402 Global Discussions
- 213 Industry Talk
- 450 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 135 Just for fun
- 56 Community Job Board
- 454 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!