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
- Customer Resources
- 65.1K Get Help
- 444 Global Discussions
- 142 Industry Talk
- 472 Announcements
- 5K Ideas & Feature Requests
- 83 Brandfolder
- 150 Just for fun
- 71 Community Job Board
- 489 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 301 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!